for my $arg (@ARGV) { #$script=$ARGV[0]; #$stanza=$ARGV[1]; $metricsfile=$ARGV[0]; $resultfile=$ARGV[1]; } #### use strict; # always! use warnings; # always! #### ### Assigning the argument file to in_file #### $in_file = $metricsfile; #### open (IN, "<$in_file") or die "Can't open $in_file: $!"; #### ### A while condition to read all the lines in a file and place in an +array#### #my $linenum=1; while(@linesFromMetrics=){ # opening while loop #### my @lines=; # or while (my $line=) { # ... #### #print "Reading metrics file \n"; #print $linenum++; #### ### Assigning the argument file to in_file #### $input_file = $resultfile; #### #!/usr/bin/perl use strict; use warnings; die "Usage: $0 \n" unless @ARGV==2; my %orig=map {$_ => 1} do { open my $fh, '<', $ARGV[0] or die $!; <$fh>; }; open my $fh, '<', $ARGV[1] or die $!; $orig{$_} and print while <$fh>; __END__