perl -MData::Dumper -e "$str='foo:bar:'; ($x,@opt)=split /:/,$str,-1;print Dumper ($x,\@opt)" $VAR1 = 'foo'; $VAR2 = [ 'bar', '' ];