sub poo { my $total_length = 0; foreach (@_[1,0,2]) { print join(' ', @$_[1..$#$_,0]), ' ', length($_->[0]), "\n"; $total_length += length($_->[0]); } print "$total_length\n"; }