Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^5: $_ not set in while <>

by kcott (Bishop)
on Jun 06, 2021 at 06:28 UTC ( #11133577=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ alias perle
    alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -MCarp::Always -E
    +'
    
  2. or download this
    $ cat > pm_11133571.dat
    234
    asdf
    quit
    ignore
    
  3. or download this
    ken@titan ~/tmp
    $ perle 'my $line; while ( (print "list of letters: "),$line=<>, $line
    + !~ /\s*quit|exit|q\s*$/i) { print "doing something with $line\n"}' p
    +m_11133571.dat
    ...
    
    list of letters:
    ken@titan ~/tmp
    
  4. or download this
    $ cat > pm_11133571_2.dat
    234
    asdf
    ignore
    
  5. or download this
    $ perle 'my $line; while ( (print "list of letters: "),$line=<>, $line
    + !~ /\s*quit|exit|q\s*$/i) { print "doing something with $line\n"}' p
    +m_11133571_2.dat
    list of letters: doing something with 234
    ...
     at -e line 1, <ARGV> line 3.
    list of letters: doing something with
    list of letters:
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2021-09-24 03:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?