Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Can you make it nicer?

by hdb (Monsignor)
on Nov 19, 2013 at 07:21 UTC ( #1063288=note: print w/replies, xml ) Need Help??


in reply to Can you make it nicer?

Similar to BrowserUk's, but using substr instead of regex:

sub id2path_new { my $id = shift or return q(); my( $pat, @d ) = length $id > 6 ? ('%09d',6,3) : ('%06d',4,2); $id = sprintf $pat, $id; substr $id, -$_, 0, '/' for @d; return $id; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063288]
help
Chatterbox?
[Discipulus]: c'mon bro' 20 begincheck and you are ok..

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2017-10-16 22:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (217 votes). Check out past polls.

    Notices?