On Thu, 28 Jun 2001, Scott Taylor wrote:
> How can I pass parameters from *nix command line to a Perl script?
> Like $1 in shell scripting.
>
> #!/usr/bin/perl -w
>
> $myfile = $1;
This will:
my $file = $ARGV[0];
@ARGV contains all of the command-line parameters.
-- Brett
On Jun 28, Scott Taylor said:
>How can I pass parameters from *nix command line to a Perl script?
> Like $1 in shell scripting.
You want the @ARGV array. $ARGV[0] is the first argument to your
program. Check the 'perlvar' documentation for more about @ARGV.
--
Jeff "japhy" Pinyan [EMAI
Hello,
How can I pass parameters from *nix command line to a Perl script?
Like $1 in shell scripting.
#!/usr/bin/perl -w
$myfile = $1;
doesn't work.
Thanks.
Scott