http://www.perlmonks.org?node_id=976723


in reply to Perl Number range lookup question

my $x = 40; print int( ( $x % 50 ) / 10 );

Replies are listed 'Best First'.
Re^2: Perl Number range lookup question
by jamesbutler (Initiate) on Jun 18, 2012 at 04:05 UTC
    ./bow Many thanks :-D
Re^2: Perl Number range lookup question
by sauoq (Abbot) on Jun 18, 2012 at 10:30 UTC

    This exactly was the first thing I wrote, but I decided I'd not do it that way because "tiers" are usually things that get changed sooner or later and I thought the OP code might just be a contrived example.

    -sauoq
    "My two cents aren't worth a dime.";