in reply to Re^3: How to improve speed of reading big files
in thread How to improve speed of reading big files
I think that this is the idiomatic Perl way to set the $_ variable to some value. It is possible to say: $_ =x;. It is possible to use $_ like in your sub above. But I think this is the idiomatic way to refer to a $variable as $_.sub filterLog() { s/ {2,}/ /g; s/^((?:\S+ ){3}).+?\[?I\]?:/$1/; s/ ?: / /g; s/ ACK (\w) / $1 ACK /; ....}
sub filterLog { my $input = shift; foreach ($input) { s/ {2,}/ /g; s/^((?:\S+ ){3}).+?\[?I\]?:/$1/; s/ ?: / /g; s/ ACK (\w) / $1 ACK /; } # $input has been modified... #....... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How to improve speed of reading big files
by BrowserUk (Patriarch) on Sep 18, 2009 at 10:24 UTC |