Help for this page
# in 5.005_02 $x = (1,2,3)[10]; # $x is undef ... $x = (1,2,3)[10]; # $x is undef @x = (1,2,3)[10]; # @x is (), not (undef) @x = (undef)[0]; # @x is (undef), not ()
# returns the collapsed list: 15 chars # 123456789_12345 ... # modifies array ref elements in place: 26 chars # 123456789_123456789_123456 sub collapse {@$_=grep{defined}@{$_=pop}}