Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: change files names bug

by keszler (Priest)
on Oct 30, 2013 at 10:45 UTC ( [id://1060318]=note: print w/replies, xml ) Need Help??


in reply to change files names bug

Does sample_ACCTGG.fq exist when the attempt to rename is made? Try
if ( -e $file ) { rename ($file, $new) or die "Can not change $file to $new, $!\n"; } else { print "$file isn't there to be renamed $new\n"; }

Replies are listed 'Best First'.
Re^2: change files names bug
by Yuma248 (Initiate) on Nov 01, 2013 at 02:02 UTC

    The file exist and the scrip actually changes the name correctly, but I dont understand why, the scrip try to change the name again and of course, because it just changed the name of the file, the file does not exit any more. However the validation that you propose

     if ( -e $file )

    allows the script finish the job, thank you

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1060318]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 05:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found