http://www.perlmonks.org?node_id=343900


in reply to Check if "System" was succesful

my first thought is to
use File::Copy; my $status = copy("file1.txt","file2.txt"); if ($status) { print "good, now deleting\n"; unlink "file1.txt"; } else { print "bad, don't delete\n"; }