in reply to Re: What is faster?
in thread What is faster?
as opposed toopen(IN, "/some/file") || die "Cant open /some/file: $!\n"; while (<IN>) { next unless (m/^$some_match/); chomp($capture = $_); } close(IN);
Especially as the size of the file being processed increases. Im not sure of the why of it, as I haven't gone poking around Perl's internals, but it certainly increased my regular useage of grep.open(IN, "/some/file") || die "Cant open /some/file: $!\n"; chomp( ($capture) = grep(/^$some_match/, <IN>) ); close(IN);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re3: What is faster?
by bbfu (Curate) on Jun 03, 2003 at 01:44 UTC | |
|
Re: Re: Re: What is faster? (grep vs while)
by Not_a_Number (Prior) on Jun 02, 2003 at 18:16 UTC | |
by l2kashe (Deacon) on Jun 02, 2003 at 19:00 UTC |