sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
The # in the url needs to be incremented for each set of 20 (or the surplus). Let's say there are 78 keys in the database.$amount_of_keys = keys %upload; # for all instances of $amount_of_keys % 20 { # print qq(<a href="url#.html></a>); # if there is a remainder that isn't % 20 { # print qq(<a href="url#.html></a>); } }
If this doesn't make any sense, please PM me and I'll try to find a different way to explain this. Thanks for taking the time to look at this.keys 1-20 would print url1.html keys 21-40 would print url2.html keys 41-60 would print url3.html keys 61-80 would print url4.html (even though we don't have 80 images, + we have a surplus and still need to generate a url for it).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash keys, %
by blokhead (Monsignor) on Jul 29, 2003 at 00:31 UTC | |
by sulfericacid (Deacon) on Jul 29, 2003 at 01:02 UTC | |
by blokhead (Monsignor) on Jul 29, 2003 at 01:30 UTC | |
|
Re: hash keys, %
by cleverett (Friar) on Jul 29, 2003 at 00:41 UTC | |
by cleverett (Friar) on Jul 29, 2003 at 00:43 UTC |