in reply to modify the contents of an array

how about:
@arr = ('092205', '092305', '092605'); $_ = join "/", unpack("a2a2a2", $_) for @arr;

later on:
print "$_\n" for @arr;

to verify the values.
should work and is nice and small.

later.
ryanc

Replies are listed 'Best First'.
Re^2: modify the contents of an array
by ryanc (Monk) on Sep 30, 2005 at 16:31 UTC
    oops, didn't read the reply above. looks like someone already offered up the 'unpack' way.