i need to pass list to my script how can i do it?
for example i have script: flow.pl i need to pass to it list of fubs :
fub1, fub2, fub3
and path to database1 =
path1
and path to database2 =
path2
and how can i get this parameters?
(through $ARGV[i]?)
if i do:
flow.pl fub1,fub2,fub3 path1 path2
and in the code:
$listoffubs = $ARGV[0]
$path1 = $ARGV[1]
$path2 = $ARGV[2]
list of fubs get name of fubs like one word.
Having lists of positional arguments is ok as long as the lists are short and simple. Once you get into a larger number of arguments or you have arguments with an internal structure, then you probably want to look at named arguments.
In this case, I think I'd be looking at using GetOpt::Long to implement named arguments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With