Robert Hanson wrote at Fri, 14 Jun 2002 17:49:03 +0200:

> How about this?
> 
> # untested
> my @mac = map {/((?:[a-fA-F0-9]{4}\.){2}[a-fA-F0-9]{4})/ and $1} ( @offline );
> 
> Rob
> 

or perhaps a little bit more readable:

my $hexdigit = qr/[a-fA-F0-9]/;
my $hexword  = qr/$hexdigit{4}/;
my $mac      = qr/$hexword \. $hexword \. $hexword/x;

my @maclist  = map {/($mac)/x} @offline;

However, it isn't necessary to put the $1 into the map routine.

BTW, isn't @offline a strange name. @offline contains online data :-)


Cheerio,
Janek


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to