sub lword{ push(@{$a[length]},$_)for(pop)=~/\b\w+/g;@{$a[-1]} } #### sub lword2{ for((pop)=~/\b\w+/g){push(@{$a[length]},$_);@b[0..-2]=''}@{$a[-1]} }