develooper Front page | perl.perl5.porters | Postings from May 2012

[perl #32915] "use numbase"

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
May 26, 2012 18:45
Subject:
[perl #32915] "use numbase"
Message ID:
rt-3.6.HEAD-7788-1338083149-439.32915-15-0@perl.org
On Wed Dec 08 14:32:47 2004, raneto wrote:
> Hello!
> 
> Thank you very much for your responses. Yes, problems with 8 and 9 are
> very
> suspicious to be octal-decimal-problems ... but I didn't recognize it.
> After
> Paul's reply I solved this Problem by writing a small subroutine
> "DEC", that
> simply deletes leading zeros. So my substitution looks like:
> 
> $a =~s/($s[0-9]+)/$b.&DEC($1)/ee;
> 
> But Yitzchak's solution looks more elegant.
> 
> May be it would be usefull to include some pragmas like "use decimal",
> "use
> octal" or "use numbase 'oct'" to ensure that only a certain base is
> used. (Or
> maybe there is already such a pargma, that I couldn't find in
> perlmodlib -
> base is something completely different). So an oktal fan could get a
> nicer
> output with something like this:
> 
> use octal
> for (my $i = 06; $i<012; $i++) {print " $i";}
> 
> (6 7 10 11 instead of 6 7 8 9)
> 
> Greetings,
> 
> Tobias
> 

List:  Is there any interest in developing the kind of pragma suggested
by Tobias in this RT?  If so, is it something that should take place in
core (and hence be tracked in RT)?  Or is it more appropriate for CPAN?

Thank you very much.
Jim Keenan



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=32915

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About