in reply to Re: [off-site] Bash + Perl oneliners basics
in thread [off-site] Bash + Perl oneliners basics
I know you're just tossing that code off quickly, but I'm curious to know why you chose to write:
while (<>) { my ($f) = (split)[6]; $count{$f}++; }
...rather than...
while (<>) { $count{(split)[6]}++; }
It makes me wonder if there's some robustness principle at work that eludes me. And of course, there is even...
$count{(split)[6]}++ while <>;
... but then we are getting into the realms of the cryptic, and I don't seen a more concise way of printing the top N values that doesn't sacrifice economy.
- another intruder with the mooring in the heart of the Perl
|
---|
In Section
Cool Uses for Perl