Peter Scott wrote:
> 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,

In _any_ context:

$ perl -le'$_ = "abc"; print scalar s/(.)//g;'
3
$ perl -le'$_ = "abc"; print s/(.)//g;'
3


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to