</lurk> On Fri, Feb 15, 2002 at 04:20:51PM +0000, Stephen Turner wrote: > Can someone explain to me why > > -l use POSIX;print strtol pop,36 > > doesn't work? Where does the extra 0 come from?
It's the number of characters in the unparsed portion of the string; those ~~ are to force it into scalar context, so it returns only the parsed number. Memo to self: ~~ is shorter than ' 0+' :-( > The shortest one which doesn't use strtol is this one: > > 2002/02/05 05:58:17 - 36 - Daniel Pfeiffer > $_=pop;$d=`echo \$((36#$_))`;print$d > > which can be rewritten as this one, three shorter than the winners: > > - 30 - > $_=pop;print`echo \$((36#$_))` > > But what's going on here? And is it legal? It's calling bash to do shell arithmetic. I don't think so, but I'm not in charge... Phil -- Philip Kendall <[EMAIL PROTECTED]> http://www.srcf.ucam.org/~pak21/