Perl Monk, Perl Meditation | |
PerlMonks |
Re: Passing parameters to scriptsby moxliukas (Curate) |
on Aug 12, 2002 at 11:16 UTC ( [id://189441]=note: print w/replies, xml ) | Need Help?? |
All command line parameters are stored in @ARGV array. So you can access it directly like:
or even like this (modifying the array):
However if you need only to pass a file name as a parameter for opening it at a later stage, you can say
straight away and this will read from the file on the command line. If you want to pass complex things on the command line (like options, etc), have a look at a module Getopt::Long And no, I don't think there is any difference in Unix and Windows in this respect. Just my 2 Lithuanian cents.
In Section
Seekers of Perl Wisdom
|
|