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

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

by chipmunk (Parson)
on Jul 13, 2001 at 18:24 UTC ( #96407=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (<>) {
      chomp;
      last if /\S/;
    }
    print "You said: $_\n";
    
  2. or download this
    my $in;
    while (local $_ = <>) {
      chomp;
      $in = $_, last if /\S/;
    }
    print "You said: $in\n";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-12-21 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (103 votes), past polls