Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Reading file into two arrays

by aaron_baugher (Curate)
on May 25, 2015 at 09:05 UTC ( [id://1127663]=note: print w/replies, xml ) Need Help??


in reply to Reading file into two arrays

split takes an optional third argument which says how many elements to split the string into, so it will work for your purposes:

my $line = "1 http:/abcd efgh/"; my($number, $address) = split ' ', $line, 2; # $number now contains "1"; # $address now contains "http:/abcd efgh/";

Aaron B.
Available for small or large Perl jobs and *nix system administration; see my home node.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-24 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found