I was wondering if someone could help me with the following code bit. It
is acting strangely.
if($ARGV[0] =~ m/^-l$|^-list$/i) {
print "What ports? (Press return after each port and CRTL-D when
done.)";
chomp(@getem = <>);
print "Who do you wanna hit, Homie? ";
chomp($peer = <>);
foreach $item (@getem) {
&pointscan($item);
}
}
else{
print "$ARGV[0] bad flag. \"-l|-list\" only good option\n";
exit(0);
}
I am trying to take "-l" or "-list" as a command line argument, but it
bombs out with this error when run.
james@warbaby:~/perl > ./sinner.pl -l
What ports? (Press return after each port and CRTL-D when done.)
Can't open -l: No such file or directory
Who do you wanna hit, Homie?
I understand that the @ARGV array if for processing files added on the
command
line, but I thought that you could use it to process flags as well. I
mean, I have before, I've looked over some of my older code, and I just
can't see what I am doing differently, or incorrectly.
All help is very much appreciated. Thank you!
-James
--
------
James Kelty
Sr. Unix Systems Administrator
The Ashland Agency
[EMAIL PROTECTED]