in reply to Wiping Out Values
just something from the top of my head, you might try:
for $level (@achievement) { push @result, $level; print 'Result: ', join (' ', @result), "\n"; @result = () if ($level =~ /5$/); } [download]