in reply to Perl file rename

Writing *.pl in a shell (not sure if CMD too) will expand automatically BEFORE it is handed over to perl's @ARGV, better quote everything!
Then there is this guy called Larry Wall, he wrote something similar once, take a look: Simple Perl file rename (posted by hilitai).

Your code almost works.... fight on!

Replies are listed 'Best First'.
Re^2: Perl file rename
by afoken (Chancellor) on Jun 04, 2015 at 07:57 UTC
    Writing *.pl in a shell (not sure if CMD too) will expand automatically BEFORE it is handed over to perl's @ARGV, better quote everything!

    No, DOS, Windows, and OS/2 don't behave like Unix at all. That would be far too easy. ;-) See Re^3: Perl Rename for a longer discussion and a workaround.

    Updated: Bad wording. Win32::Autoglob really does not help here (see AM answer below), it only helps hiding one difference between Win32 and Unix systems.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)