# ... prompt and read user input ... then: chomp $l, $t, $w; #### my $Usage = "Usage: $0 LOT# W# tester#\n"; die $Usage unless ( @ARGV==3 and join(" ",@ARGV) =~ /LOT\d+ W\d+ tester\d+/ ); my ( $l, $w, $t ) = @ARGV; print "Command line args were:\n $l\n $w\n $t\n"; my $sdtfile = "C:\\bzip\\sdt.log"; if (open (MAPFILE, "< $sdtfile")) { my @lines = ; chomp @lines; my @fields = qw/time lot waf ts sstep machine product plnfile striping/; my %row; foreach $line (@lines) { @row{@fields} = split /,/, $line; if ($l eq $row{lot} && $w eq $row{waf}) { # do something... } } }