brianarn has asked for the wisdom of the Perl Monks concerning the following question:
I tried ARGV[0] by instinct from C and, of course, got the first argument I called the function with - blew my mind till I did for (@ARGV) {print "$_\n}; and saw that it didn't have the script name.#!/usr/local/bin/perl use strict; if (@ARGV != 2) { print "Usage: (program name) arg1 arg2\n"; exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Anything comparable to argv0 from C in Perl?
by tye (Sage) on Apr 11, 2001 at 00:06 UTC | |
|
Re: Anything comparable to argv0 from C in Perl?
by japhy (Canon) on Apr 11, 2001 at 00:01 UTC | |
|
Re: Anything comparable to argv0 from C in Perl?
by satchboost (Scribe) on Apr 11, 2001 at 00:00 UTC | |
|
Re: Anything comparable to argv0 from C in Perl?
by jink (Scribe) on Apr 11, 2001 at 22:10 UTC | |
by DrManhattan (Chaplain) on Mar 13, 2003 at 21:38 UTC |