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.
In reply to Re: Win32 File Creation Weirdness, ActivePerl 5.8.8
by Corion
in thread Win32 File Creation Weirdness, ActivePerl 5.8.8
by missingthepoint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |