Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 about the Monastery: (13)
As of 2014-09-22 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls