in reply to Accessing an array of anonymous hashes

I may be way out of line here, but I think you might have an XY Problem. Let me state your problem as I understand it, and please correct me (or just ignore this post) if I'm wrong.

You have three variables (we don't care where they came from). Let's call them:

my $agency = 'XY'; # A string between 1 and 3 characters long my $date = '2007/6/3'; # Or whatever date format my $type = 'T'; # A single character

and you want to concatenate their values together into a 12-character string, padding them out if necessary (I assume with spaces in the text field, and with zeroes in the date field) so that they will be respectively 3, 8 and 1 characters long. In other words, the required output for the example data above would be:

XY 20070603T

If so - and I apologise again if I've missed something - why not simply use a combination of join and sprintf?

my $string = join '', sprintf( '%-3s', $agency ), sprintf( '%04d%02d%02d', split /\//, $date ), $type;