in reply to array problem - splitting array

use strict; use warnings; my @sen = ('I', 'want', '', 'chocolate', 'and', '', 'icecream'); print join '/', @sen; @sen = grep {length} @sen; print "\n" . join '/', @sen;

Prints:

I/want//chocolate/and//icecream I/want/chocolate/and/icecream

DWIM is Perl's answer to Gödel