Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Custom-length random/unique string generator

by Athanasius (Abbot)
on Feb 02, 2013 at 17:43 UTC ( #1016730=note: print w/ replies, xml ) Need Help??


in reply to Custom-length random/unique string generator

A minor point:

From the Camel Book (4th Edition, 2012, page 695), under the heading “Time Efficiency”:

  • If you’re deleting characters, tr/abc//d is faster than s/[abc]//g.

So, if speed is a limiting factor, consider replacing:

# Strip out "+" and "/" $buildID =~ s/\+//g; $buildID =~ s/\///g;

with:

$buildID =~ tr{+/}{}d;

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,


Comment on Re: Custom-length random/unique string generator
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (18)
As of 2015-07-06 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (77 votes), past polls