in reply to Text Manipulation Quickie

Heres yet another solution... As for the others the behaviour for when your file contains a different set of digits is only assumed to be correct. Basically it outputs inorder sequences of the input file until all of the numbers in the input file have been exhausted.

my @array; while (<DATA>) { chomp; $array[$_]++; } my $found_flag=1; while ($found_flag) { $found_flag=0; for my $o (0..$#array) { if ($array[$o]) { print $o,"\n"; $array[$o]--; $found_flag=1; } } } __DATA__ 2 2 2 3 3 3 4 4 4

Yves / DeMerphq
---
Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)