Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: I don't get map. How would I use map here?

by Chady (Priest)
on Jun 19, 2004 at 09:42 UTC ( #368139=note: print w/ replies, xml ) Need Help??


in reply to I don't get map. How would I use map here?

One OT but related note is the use of for to read from a filehandle.

I got bitten by that before.

for will create the list and iterate over it. This means that if <DATA> is a filehandle to a file containing 1Gb of data, for will attempt to create the 1Gb+ list, thus bringing your system to its knees.

The 'safer' way to do this would be to use a while instead of for because it doesn't create the list.


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/


Comment on Re: I don't get map. How would I use map here?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (18)
As of 2015-07-07 17:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (92 votes), past polls