use strict; use warnings; while (<DATA>) { my $ipaddr = (split /\s+/, (split /#/, $_)[0])[1]; print "ipaddr = $ipaddr\n"; } __DATA__ client 127.0.0.1#47560: query: host.example.com IN AAAA +
prints:
ipaddr = 127.0.0.1
In reply to Re: split split
by toolic
in thread split split
by Plankton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |