I want to compare what is in
$ARGV[0] an array that I created from a file that contains single line entries.
This is what I have so far:
#!c:\perl\bin -w
use strict;
open downfile, '>f:\scripts\text\nodedown.txt':
print downfile "$ARGV[1] $ARGV[2] is Down on $ARGV[0].\n";
close downfile;
my $routers="F:/scripts/text/routers.txt";
open routers, $routers or die "cannot open $routers: $!\n";
my @lines = <routers>;
close routers;
my ($zero_arg, $first_arg, $sec_arg) = @ARGV[0..2];
if (grep {$zero_arg eq $ARGV[0]} @lines) {
system('f:\usr\ov\bin\nvecho.exe GOT IT');
}
exit 0;
Is there a better way to do this?