in reply to Re: upto match please, my one-lina!!
in thread upto match please, my one-lina!!

$ which perl /usr/bin/perl $ perl -ne "push @a,$_; /foo/ and exit 1; shift @a if $#a>3; END{$?==1 + and print @a }" file Bareword found where operator expected at -e line 1, near "0a" (Missing operator before a?) syntax error at -e line 1, near "0a" Execution of -e aborted due to compilation errors.


That sure is unexplained .. 0a??? where'd that come from. Seems the double quotes are playing a part in inducing this behaviour. Under singles it works fine.

Replies are listed 'Best First'.
Re^3: upto match please, my one-lina!!
by japhy (Canon) on Jun 09, 2006 at 01:24 UTC
    NetWallah is probably on Win32, where the double-quotes are necessity. Your unixy shell is interpolating $# and replacing it with '0' in your code; thus: shift @a if 0a>3;

    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart