my @src; { my $tmp = $a; push @src, substr( $tmp, 0, 7, "" ) while $tmp; } # . . . as above . . .