Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: splitting arrays

by Roy Johnson (Monsignor)
on Apr 15, 2005 at 14:30 UTC ( [id://448177]=note: print w/replies, xml ) Need Help??


in reply to Re^2: splitting arrays
in thread splitting arrays

If your goal is to read 50 items into an array on each pass of the loop:
while (!eof DATA) { local $/="\t"; chomp(my @set = map {(eof) ? () : scalar(<DATA>)} 1..50); print "Set: ", join(',', @set), "\n"; }
Use whatever filehandle is appropriate.
Update: changed second eof to use "last file read" default form.

Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-20 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found