in reply to fall through switch/case in perl

If you really want the case statement, there are many ways of doing it, as per the Programming Perl, a.k.a. the "Camel" book.

However, I think the following might be more what you need.

print substr("abcdefghij",10-$var),"\n";

Hope that helped,
-v
"Perl. There is no substitute."

Replies are listed 'Best First'.
Re^2: fall through switch/case in perl
by Pragma (Scribe) on Sep 07, 2004 at 19:31 UTC
    print splice @{[a..j]}, -$var

    or better yet:

    print( (a..j)[-$var..-1] )