perl script problem - TechRepublic
General discussion
July 27, 2005 at 12:02 PM
cpfeiffe

perl script problem

by cpfeiffe . Updated 20 years, 10 months ago

Hello all,
I have a simple perl statement that I can’t get to work…

system(“cp“) || print “copy failed\n” ;

The problem is that it copies the file and also prints the message. The return code $! is “No such file or directory”. But the file copied to the right place. I have tried various sources and targets. I have tried with or without the trailing slash on the target directory and even hard coding the target file. I have tried or instead of ||.

Any help would be appreciated very much.

This discussion is locked

All Comments