in reply to Re^3: Removing and replacing values from an array.
in thread Removing and replacing values from an array.
The regex to match URLs could be refined (and I would refine it in my real programs), but that's just a quick example.my (@ips, @urls); while (<>){ last if !/\S/; s/\s+.*//; s/\[\.\]/./g; if (/[^\d\.]) { push @urls, $_; } else { push @ips, $_; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Removing and replacing values from an array.
by kennethk (Abbot) on Aug 18, 2014 at 18:34 UTC | |
by Laurent_R (Canon) on Aug 18, 2014 at 18:55 UTC |