my $id = 'data4'; my $result; while (<$fh>) { /^\Q$id\E\s/ or next; ($result) = /\s(\S+)$/; last; } die "not found" if !defined($result);
In reply to Re: random search in file
by ikegami
in thread random search in file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |