in reply to Re^2: print to output problem
in thread print to output problem
It's not clear to me what the $NUM17 and $NUM18 business is all about, or what $etc is for. What I've done is assume that $etc indicates which $RES to look for, to print the associated $val.my @requests = (); my %lookups = (); while (<FILE>) { if (/^# input/) { push @requests, (split)[1]; } elsif (/^\s\s\d+/) { my ($RES, $val) = (split)[2,4] $lookups{$RES} = $val; } } print join("\n", @lookups{@requests}), "\n";
|
|---|