in reply to help related to modifiaction of read only value attempted error
It's not obvious from the code you posted. However, I will guess that if you used my instead of local on your variables as appropriate, you'd clear up the error. Try this line instead:
my $status = system("mv $filename1 $newfile");Of course, I'd write that code as:
unless (system("mv $filename1 $newfile") == 0) { print "FAILED WHILE MOVING mv $filename1$newfile\n"; return 1; }
That avoids the variable altogether.
Another suggestion is to look into the module File::Copy and the operators unlink and rename, so as to avoid unnecessary system calls.
|
|---|