Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^4: Split() first 3 elements of @array

by Kenosis (Priest)
on Aug 28, 2012 at 20:48 UTC ( #990333=note: print w/replies, xml ) Need Help??

in reply to Re^3: Split() first 3 elements of @array
in thread Split() first 3 elements of @array

use Modern::Perl; use Modern::Perl; say ' IP address:' =~ /IP\s+address:\s+([^\s]+)/; say 'IP address:' =~ /IP\s+address:\s+([^\s]+)/; say ' IP address:' =~ /^\s*IP\s+address:\s+([^\s]+)/; say 'IP address:' =~ /^\s*IP\s+address:\s+([^\s]+)/;


Update: Ah! hmb104 was referring to using split, not the regex (which isn't attempting to match at the beginning of a line and is fully anchored w/o mentioning the spaces before "IP address:").

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://990333]
[LanX]: met a guy from Aberdeen durin holidays, liked Scotsish accent a lot ... very phonetic
[LanX]: ... understood everything after mentally write down what he said.
[choroba]: Trainspotting?
[choroba]: Ouch, trailing commas in JSON :-(
[LanX]: ... though there seems to exist a taxation for the letter 't' in Northern Bri''ain ;-)
[LanX]: never seen trainspotting in OV ... :(
[karlgoethebier]: LanX
[LanX]: They should teach Scottish in continental schools after Brexit !!!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2018-02-19 10:42 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (261 votes). Check out past polls.