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