joec_ has asked for the wisdom of the Perl Monks concerning the following question:
Hi, am i missing something? I have this code:
$molfile=shift || die ('script takes one arg from CL');
And when i call it like
./service.pl file.txt
I always get the die error message displayed. I have to explicitly say
$molfile = $ARGV[0] || die.....;
to get it to work.
This is a bit strange as i have the same code in a different file that works...
Any thoughts?
Thanks
Joe.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: shift doesnt shift
by jplindstrom (Monsignor) on Nov 27, 2008 at 13:59 UTC | |
by joec_ (Scribe) on Nov 27, 2008 at 14:04 UTC | |
by vlsimpson (Beadle) on Nov 27, 2008 at 20:31 UTC | |
by jplindstrom (Monsignor) on Nov 28, 2008 at 12:19 UTC | |
Re: shift doesnt shift
by ForgotPasswordAgain (Priest) on Nov 27, 2008 at 13:42 UTC | |
Re: shift doesnt shift
by mje (Curate) on Nov 27, 2008 at 13:43 UTC | |
by joec_ (Scribe) on Nov 27, 2008 at 13:51 UTC | |
by Corion (Patriarch) on Nov 27, 2008 at 13:56 UTC | |
by SuicideJunkie (Vicar) on Nov 27, 2008 at 14:03 UTC | |
Re: shift doesnt shift
by zentara (Archbishop) on Nov 27, 2008 at 13:42 UTC | |
Re: shift doesnt shift
by Bloodnok (Vicar) on Nov 27, 2008 at 13:59 UTC |
Back to
Seekers of Perl Wisdom