in reply to split split

You can split split, but it may not be the best solution:
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