Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Flip-flop won't DWIM

by wu-lee (Beadle)
on May 21, 2009 at 15:39 UTC ( #765480=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      # Get everything between B and D:
      perl -lwe 'print join " ", grep scalar(/B/../D/), qw(A B C D E F)'
      # prints:
      # B C D
    
  2. or download this
      # Get everything between up to D:
      perl -lwe 'print join " ", grep scalar(1../D/), qw(A B C D E F)'
    ...
      # Use of uninitialized value in range (or flip) at -e line 1.
      # Use of uninitialized value in range (or flip) at -e line 1.
      # Use of uninitialized value in range (or flip) at -e line 1.
    
  3. or download this
      # Get everything up to and D:
      perl -lwe 'print join " ", grep scalar(/./../D/), qw(A B C D E F)'
      # prints:
      # A B C D E F
    
  4. or download this
      # Get everything up to D:
      perl -lwe 'print join " ", map scalar(/./../D/), qw(A B C D E F)'
      # prints:
      # 1 2 3 4E0 1 2
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://765480]
Approved by jettero
Front-paged by wfsp
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2023-10-03 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?