Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: When is $_ local and when is it not?

by Abigail (Deacon)
on Jul 13, 2001 at 19:24 UTC ( #96437=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: When is $_ local and when is it not?
in thread When is $_ local and when is it not?

Yes, I think it should work that way. Then you can write code like:

sub next_foo { while (<>) { return $. if /^FOO:/ } } while (next_foo) { do_something # with $_ }
Some people won't like this style. That's fine, you don't have to. Other will like it, and Perl let's you.

-- Abigail


Comment on Re: When is $_ local and when is it not?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2015-07-02 23:13 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 (47 votes), past polls