On Mon, Sep 17, 2001 at 09:25:07AM +1000, Crossfire wrote:
> my @splitline = split /\s+/, $line;
> my @ipaddr = ();
> foreach $i (@splitline) {
>       if ($i =~ m/^\d+\.\d+\.\d+\.\d+$/) {
>               push @ipaddr, $i;
>       }
> }

>       if ($i =~ m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) ...

  Yuck :)

  my @ips = grep { /^(\d{1,3}\.){3}\d{1,3}$/ } split /\s+/, $line;

m.

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to