Help for this page

Select Code to Download


  1. or download this
    while ( ($x) = shift @a ) {
      ...
    }
    
  2. or download this
      DB<170> @a=1..2
     => (1, 2)
    ...
    
      DB<173> ( ($x) = shift @a ) ? $x : "false"
     => undef                   # true!
    
  3. or download this
      DB<174> @a=1..2
     => (1, 2)
    ...
    
      DB<177> ( ($x) = splice @a,0,1 ) ? "$x" : "false"
     => "false"
    
  4. or download this
    The following equivalences hold (assuming "$[ == 0 and $#a >= $i" )
    
    ...
                       shift(@a)           splice(@a,0,1)