Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

RE: RE (tilly) 3: each or keys?

by extremely (Priest)
on Oct 11, 2000 at 03:52 UTC ( [id://36161]=note: print w/replies, xml ) Need Help??


in reply to RE (tilly) 3: each or keys?
in thread each or keys?

Ouch, I was aware of the fix that allows 1..1000000 to work, thus I started my post with "And...", I was, however under the impression that  foreach (<FH>) {} was special vs. foreach (<>) {}.

Guess I's been spoilt by dem fancy computairs wif all dat memoree. =) And I never tried to use $. before either, THAT would have made the problem clearer...

#!/usr/bin/perl -w open FH, "</really/huge/file" or die "Eeek, $!\n"; foreach (<FH>) { print "$. - $_"; }

Ow! Every line has the same line number! =)

--
$you = new YOU;
honk() if $you->love(perl)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-16 12:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found