[Edinburgh-pm] perl one-liner problem

Adriano Ferreira aferreira at shopzilla.com
Sat Jul 19 12:07:41 PDT 2008

On Sat, Jul 19, 2008 at 3:16 PM, A Smith <asmith9983 at gmail.com> wrote:
> I was trying the Perl one liner below but it complains about an unrecognized
> switch. despite this the value is passed into the code.  I was trying to
> avoid a full script file with a getopts and its baggage.
> perl -s -e "print $oldage;" -oldage=abc

It seems like you need '--' to stop perl for interpreting the
command-line arguments:

perl -s -e "print $oldage;" -- -oldage=abc

> Anyone got an idea what will work.
> Andrew
> _______________________________________________
> Edinburgh-pm mailing list
> Edinburgh-pm at pm.org
> http://mail.pm.org/mailman/listinfo/edinburgh-pm

More information about the Edinburgh-pm mailing list