in reply to splitting an array element

When I think of fixed-length fields, I always think of unpack:
my $data = '19600326'; print join('-', unpack('A4A2A2', $data));
or
my $data = '19600326'; printf ('%s-%s-%s', unpack('A4A2A2', $data));

Update: Ack! Zaxo beat me to it by a couple of minutes. :-)


Impossible Robot