Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: opening a file destroys nulling entries in a list?!?!

by bobn (Chaplain)
on Aug 07, 2003 at 03:38 UTC ( #281728=note: print w/replies, xml ) Need Help??


in reply to Re: opening a file destroys nulling entries in a list?!?!
in thread opening a file destroys nulling entries in a list?!?!

How come while(<IN>){}, but not for (@x) {}? why is while (<IN>) so special?

I love perl, but this scares the hell out of me.

--Bob Niederman, http://bob-n.com

Replies are listed 'Best First'.
Re: Re: Re: opening a file destroys nulling entries in a list?!?!
by bobn (Chaplain) on Aug 07, 2003 at 03:45 UTC

    Nevermend. I think I get it - someone else posted that while(<>){} is the same as while($_=<>){} - it does an assignment to $_ and that's what does the damage.

    Somehwere, I think I remember someone (Tom Christiansen, I think) saying to always localize $_ in subroutines. Now I know why.

    --Bob Niederman, http://bob-n.com

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://281728]
help
Chatterbox?
[Corion]: TCLion: I'm not aware of a better way than manually building the hash, as all strptime incarnations I know have nasty edge cases
[davido]: And remember; time is hard. :) As soon as you think, I've got this, you'll discover that time is harder than that. :)
[1nickt]: TCLion are you parsing the dates with DateTime or another tool?
[1nickt]: I note DateTime::Format:: Flexible, announced immediately below this box in the CPAN feed

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2017-03-23 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (287 votes). Check out past polls.