I have looked through the postings and FAQ and am unable to find the specifics on this question. It may be there and I may be querying correctly.
Anyway, I am trying to figure out how to pass a parameter into a program from the command line. I have seen the following:
perl -w myscript.pl name=bob
Is there a line of the magic ARGV in myscript.pl or is it one of the assumed aspects of Perl?
What I am attempting to do is pass an IP address into a Perl script that will use that IP to query a MySQL db for predetermined fields.
I have used ascript.pl < IP.txt to pull in IP addresses, but that is using a file not an argument.
I am using
while (<>){
$input = "$_";
}
and then variable $input is used in a DBI call into MySQL.
Any assistance is appreciated.
Anyway, I am trying to figure out how to pass a parameter into a program from the command line. I have seen the following:
perl -w myscript.pl name=bob
Is there a line of the magic ARGV in myscript.pl or is it one of the assumed aspects of Perl?
What I am attempting to do is pass an IP address into a Perl script that will use that IP to query a MySQL db for predetermined fields.
I have used ascript.pl < IP.txt to pull in IP addresses, but that is using a file not an argument.
I am using
while (<>){
$input = "$_";
}
and then variable $input is used in a DBI call into MySQL.
Any assistance is appreciated.