Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by kcott (Archbishop)
on Jun 06, 2021 at 06:28 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-24 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found