On Wed, 17 May 2006 10:57:44 -0400, Zembower, Kevin wrote:
> I tried to combine them into this:
>
> perl -ne 'print unless $seen{s/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
> .*/$1/}++' access.log
>
> but it just returns the first entry of the file.
And the problem with that is that in a scalar context the result of a s///
operation is the number of substitutions made, which means you are doing
$seen{1}++ each time.
--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>