Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 chilling in the Monastery: (8)
As of 2014-07-25 23:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls