Have you ever tried to wade through The Silmarillion?
Craig Hammer
-Original Message-
From: Elias Assmann [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 3:45 PM
To: Randal L. Schwartz
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Perl programmer born and bred
On
John,
Thanks for the optimized version. The outfile isn't used yet. I have it
sitting there because that is the next step.
Craig Hammer
Internal Infrastructure Team Lead
Parago, Inc.
972-538-3936
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [
Langa,
Take a look at this script. I created it to read my firewall log files, and
then give me a sort and count per unique address. You could substitute a
more traditional grep in place of the substitution I use.
<>
Craig Hammer
Internal Infrastructure Team Lead
Parago, Inc.
972-53
Thank you Felix and Bob. I see I was approaching this compeltely wrong.
Craig Hammer
-Original Message-
From: Felix Geerinckx [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 8:23 AM
To: [EMAIL PROTECTED]
Subject: Re: converting a hash to an array
on Wed, 29 May 2002 12:58:33
ackk, I missed the $ in all of my re-arranging.
The script still fails at the same place. The real error is:
glob failed (child exited with status 1) at ./newlogscan.pl line 48.
Craig Hammer
Internal Infrastructure Team Lead
Parago, Inc.
972-538-3936
-Original Message-
From: Jackson
uot;, $sorted{1}, $sorted{2}
) ;
}
I am trying to sort the hash values (by value, not key) and move the sorted
results into an array, so that I can add additional fields later.
I get an "Use of uninitialized value at ./newlogscan.pl line 46." error.
Line 46 is the @sorted = line.
m perlfaq4 (perldoc -q uniq)
my $prev = "NO_SUCH_VALUE";
my @sorted = grep { $_ ne $prev and $prev = $_ } sort @records;
and
# b -- also from perlfaq4
my %seen;
my @sorted = sort grep !$seen{$_}++, @records;
On May 23, A. Rivera said:
>On May 23, Craig Hammer said:
>>
. Is there something similar to uniq
within perl? (I already have it sorting correctly)
Craig Hammer
Internal Infrastructure Team Lead
Parago, Inc.
972-538-3936