Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: generating random filenames

by PrakashK (Pilgrim)
on Jul 10, 2001 at 19:36 UTC ( #95330=note: print w/ replies, xml ) Need Help??


in reply to generating random filenames

for ($current_length = 1; $current_length >= $length_limit; $curre +nt_length++) { .... }
This loop never executes, because of incorrect checking of $current_length. Change the >= to <=:
for ($current_length = 1; $current_length <= $length_limit; $curre +nt_length++) { .... }
Or, better yet:
for $current_length (1 .. $length_limit) { .... }
/prakash


Comment on Re: generating random filenames
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (13)
As of 2015-05-04 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (94 votes), past polls