- or download this
# write.pl
...
sleep 5;
system('echo "hello world" > foo.txt');
}
- or download this
# copy.pl
...
my $file1 = 'foo.txt';
my $status = system("cp $file1 file2");
- or download this
$ perl -w copy.pl
cp: cannot stat `foo.txt': No such file or directory
- or download this
# copy2.pl
...
last if -e $file1 && ! qx/lsof $file1/;
}
my $status = system("cp $file1 file2");