in reply to Re^2: change files names bug
in thread change files names bug

You said works for the first files, buy then die with the massage "Can not change sample_ACCTGG.fq to ACCTGG.fq". But when I print $new, it is "LA01.fq" that is correct.

but the code is  rename ($file, $new) or die "Can not change $file to $new, $!\n"; so the error message you quoted is incomplete, it doesn't state the reason it rename didn't work

This reason is everything

Replies are listed 'Best First'.
Re^4: change files names bug
by roboticus (Chancellor) on Oct 30, 2013 at 11:14 UTC

    Not to mention that the presented error message shows $new as being ACCTGG.fq, and the OP asserts that it is LA01.fq. Incorrect/incomplete reporting of error messages and other results makes remote diagnosis an exercise in clairvoyance.

    ...my crystal ball is still in the shop. (It kept reporting "line 42".)

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re^4: change files names bug
by Yuma248 (Initiate) on Nov 01, 2013 at 03:06 UTC

    Sorry the complete error say "Can not change sample_ACCTGG.fq to ACCTGG.fq, sample_ACCTGG.fq does not exist"