http://www.perlmonks.org?node_id=1208815


in reply to Re^3: Comparision Utility PERL
in thread Comparision Utility PERL


my ($file1,$file2,@cols) = @ARGV; open( my ($fh2), $file2 ) or die $!; #just the file2 operations while ( my $row = <$fh2> ) { chomp $row; #print "$row\n"; next if $row =~ /^\s*$/; $row =~ s/^\s+|\s+$//g; my (@fields) = split( /\|/, $row ); # print "$fields[0]\n "; for my $fieldnum (@cols) { if ( exists $hash{ $fields[$fieldnum] } ) { print $fh "$row\n"; next; } } }
is this correct because i have to pass array variables in CL. i was able to print but then how do i deal with arrays