Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Can you make it nicer?

by hdb (Prior)
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; }


Comment on Re: Can you make it nicer?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2014-10-23 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (124 votes), past polls