Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: split split

by linuxer (Deacon)
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";


Comment on Re: split split
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://774121]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2015-01-31 23:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (261 votes), past polls