You want unpack.
my $date = '20050725'; my ($y, $m, $d) = unpack('a4a2a2', $date); print "$y / $m / $d\n";
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: Splitting up a string by lengths
by davorg
in thread Splitting up a string by lengths
by cosmicperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |