Help for this page

Select Code to Download


  1. or download this
    @last_n = grep { defined $_ } @source[ -$n .. -1 ];
    
  2. or download this
    $ perl -wle '@a = 1..3; @b = grep { defined $_ } @a[-4 .. -1]; print "
    +<$_>" for @b;'
    Modification of non-creatable array value attempted, subscript -4 at -
    +e line 1.
    ...
    <1>
    <2>
    <3>