Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by chipmunk (Parson)
on Jul 13, 2001 at 18:24 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://96407]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-03-29 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found