Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Can you make it nicer?

by oiskuu (Pilgrim)
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 about the Monastery: (12)
As of 2014-07-28 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (207 votes), past polls