#!perl use strict; use warnings; use Data::Dumper; print Dumper [sort { @$a <=> @$b } &p(@ARGV ? @ARGV : (0,'',undef))]; sub p { my @p = ([]); push @p, map [@$_,$_[0]], @p and shift while @_; @p } #sub p { @_ || return []; my $e = shift; p(@_),map [@$_,$e], p(@_) }