and -a is described as: -a autosplit mode with -n or -p (splits $_ into @F)
yes, but you ommitted the -a switch from your 2nd one-liner.
You didn't need it in the first one because you explicity declared @F
The following works fine for me:
ls -al | perl -F// -lane '$i=0; @a = map {$i++%2 ? $_ : " "} @F; print + @a;'
Cheers,
Darren :)
In reply to Re: Perl oneliner problem with -F switch
by McDarren
in thread Perl oneliner problem with -F switch
by bfilipow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |