array of numbers with padded zeroes

2005-03-15 Thread Bryan R Harris
I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. But if my hash had 750 elements, I'd want it to go from 001 to 750. I thought

RE: array of numbers with padded zeroes

2005-03-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Bryan R Harris wrote: I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. The real question is what are you attempting

RE: array of numbers with padded zeroes

2005-03-15 Thread Bob Showalter
Bryan R Harris wrote: I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. But if my hash had 750 elements, I'd want it to go

Re: array of numbers with padded zeroes

2005-03-15 Thread Bryan R Harris
I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. The real question is what are you attempting to do? With the hash, you

Re: array of numbers with padded zeroes

2005-03-15 Thread Bryan R Harris
Thanks to everyone who replied! Your suggestions cleaned out a block in my mind, and I got it figured out. Here's what works, for those interested: @allkeys = ('0' x (length(keys(%data)) - 1) . '1' .. (keys(%data)) . ); - B ps. Is there an easy way to test this versus the solution below,

RE: array of numbers with padded zeroes

2005-03-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Bryan R Harris wrote: I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. The real question is what are you attempting to

Re: array of numbers with padded zeroes

2005-03-15 Thread John W. Krahn
Bryan R Harris wrote: I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. But if my hash had 750 elements, I'd want it to go from 001 to

Re: array of numbers with padded zeroes

2005-03-15 Thread John W. Krahn
Wagner, David --- Senior Programmer Analyst --- WGO wrote: John W. Krahn wrote: Bryan R Harris wrote: I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e.