in reply to Re: Shorter/Better way to rename list of files in a directory
in thread Shorter/Better way to rename list of files in a directory

I dodidn't think my @list = `dir`; does what you think it does. Backticks will put the entire listing into a single string, $list[0]. File::Rename's overridden rename will fail since the listing will never match a file name (even with only one file - newline tacked on).

Here, too, glob would be preferable for populating @list.

Update: Oops. Major thinko. I'll stand by preferring glob to shelling out.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^3: Shorter/Better way to rename list of files in a directory
by Fletch (Bishop) on Jun 02, 2006 at 12:15 UTC

    Erm, backticks in a list context split the returned output on $/. See perlop.