- To: Crossfire <xfire@xxxxxxxx>
- Subject: Re: [SLUG] Perl IP's etc
- From: dichro@xxxxxxxxxxxxxxxxxxxxxxxx (Mikolaj J. Habryn)
- Date: Mon Sep 17 10:47:01 2001
- Cc: peterw <peterw@xxxxxxxxxxxxxx>, Scott Howard <scott@xxxxxxxxxx>, "slug@xxxxxxxxxxx" <slug@xxxxxxxxxxx>
- User-agent: Mutt/1.3.20i
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.