foreach (@numbers) { print $output x $_; $output = $pat{$output}; }