in reply to Re^2: Getting range from N..end with list slice
in thread Getting range from N..end with list slice

... that pesky LHS > RHS returns empty list rule!

Not exactly pretty, and still won't work with a list, but:

>perl -wMstrict -le "my @ra = qw(a b c d e f g h); my $i = 4; print qq{'$_'} for @ra[$i - @ra .. -1]; " 'e' 'f' 'g' 'h'

Replies are listed 'Best First'.
Re^4: Getting range from N..end with list slice
by ikegami (Patriarch) on Nov 28, 2010 at 23:37 UTC

    It's actually even simpler:

    @ra[$i .. $#ra]

    The difference between an array slice and a list slice is that you have the array before the slice is evaluated.

      ... even simpler:  @ra[$i .. $#ra]

      Yes, but that's also the prettier version! My intent, clumsily realized, was to endorse the idea that negative indexing off the end of an array (or, in the OP, a list) isn't the way to go.