Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Can you make it nicer?

by oiskuu (Friar)
on Nov 19, 2013 at 13:45 UTC ( #1063331=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        my $id = shift;
        # disallow ID 0;
        $id > 0 && $id < 1e9 or return q();
        $id = sprintf '%0*lu', ($id < 1e6 ? 6 : 9), $id;
        ...
    
  2. or download this
    sub id2path {
        my $id = shift;
    ...
        # or: substr($id, $_, 0, '/') for -2*$n, -$n;
        return $id;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063331]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-02-27 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    On my keyboard, Caps lock is:








    Results (437 votes), past polls