SLUG Mailing List Archives
Re: [SLUG] Perl IP's etc
- To: Scott Howard <scott@xxxxxxxxxx>
- Subject: Re: [SLUG] Perl IP's etc
- From: peterw <peterw@xxxxxxxxxxxxxx>
- Date: Mon Sep 17 00:07:01 2001
- Cc: "slug@xxxxxxxxxxx" <slug@xxxxxxxxxxx>
Scott Howard wrote:
> On Sun, Sep 16, 2001 at 11:39:33PM +1000, peterw wrote:
> > Given an alpha numeric string of vaying length that contains 0 or more
> > valid IP numbers(dotted quad decimal)and each IP(if there is one) is
> > seperated form the next IP or other text by one or more spaces how can I
> > use Perl to retrieve thes IP's into an array ?
> Presuming the string is in $_
> @IP = split;
Sorry should have explained better. String can have one or more groups
of alpha numeric characters. Each group of chracters is seperated by one
or more spaces. Each group can have one or more charcters. Zero or more
of these groups may be a valid IP. The IP 's can occur anywhere in the
string. The IP's may or may not be consecutive.
If I use split how do I know which array elements are the IP's ?