in reply to Win32 File Creation Weirdness, ActivePerl 5.8.8

Most likely that is a quoting issue between cmd.exe and Perl. I try to avoid double quotes in my oneliners:

perl -e "for (glob '*') { my ($id) = /(\d+)$/ || /^(\d+)/; print qq($_ + => id=$id\n); }"

If you want to find out what Perl sees, use B::Deparse:

>perl -MO=Deparse -e "for (glob '*') { my ($id) = /(\d+)$/ || /^(\d+)/ +; print qq($_ => id=$id\n); }" use File::Glob (); foreach $_ (glob('*')) { my($id) = /(\d+)$/ || /^(\d+)/; print "$_ => id=$id\n"; } -e syntax OK >perl -MO=Deparse -e "for (glob '*') { my ($id) = /(\d+)$/ || /^(\d+)/ +; print \"$_ => id=$id\n\"; }" -e syntax OK >

So Perl doesn't even want to tell me what's going on with the double-quote thing.

Replies are listed 'Best First'.
Re^2: Win32 File Creation Weirdness, ActivePerl 5.8.8
by missingthepoint (Friar) on Jul 07, 2009 at 08:51 UTC

    Many thanks Corion++! That fixed it. :)

    I try to avoid double quotes in my oneliners

    That's good advice. I need to remember to use the special quoting operators! Incidentally, I hate the windows shell.


    The zeroeth step in writing a module is to make sure that there isn't already a decent one in CPAN. (-- Pod::Simple::Subclassing)