Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Pattern match and splitting of that

by toolic (Bishop)
on Jun 22, 2017 at 13:39 UTC ( [id://1193295]=note: print w/replies, xml ) Need Help??


in reply to Pattern match and splitting of that

split is an appropriate tool for this job:
use strict; use warnings; use Data::Dumper; my $string = "RABBIT 45 -126.06686"; my @parts = split /\s+/, $string; print Dumper(\@parts); __END__ $VAR1 = [ 'RABBIT', '45', '-126.06686' ];

Also, the code you posted has a compile error.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-25 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found