in reply to Re: = - not only for sort anymore
in thread <=> - not only for sort anymore

Nice use of <=>, but I think this might do the same thing even easier

    for $i (0..5) { print substr("|||||*",5-$i,5), "\n" }

Replies are listed 'Best First'.
Re: Re: Re: = - not only for sort anymore
by jrifkin (Initiate) on Apr 18, 2001 at 22:14 UTC
    Oops, sorry. We were talking about names, not numbers. So how about this

       $seen=0;
       for $i (@list) { last if $i eq $pos; $seen++ }
       print substr("|||||*     ", 5-$seen, 5), "  $pos\n";