Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: split split

by linuxer (Curate)
on Jun 23, 2009 at 17:42 UTC ( #774121=note: print w/replies, xml ) Need Help??


in reply to split split

If you are sure about the format of your input data (order of fields, number of whitespaces, ...), you can try something like this:

my $line = 'client 127.0.0.1#47560: query: host.example.com IN AAAA +' +; my ( $ip, $host ) = ( split /[ #]/, $line, 6 )[1,4]; print "IP: $ip, HOST: $host\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://774121]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-03-24 14:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (303 votes). Check out past polls.