# This works. my @ary; @ary = split (" ",$_) while (); print join(" / ", @ary); #As does this my ($str,@ary); @ary = split (" ",$str) while ($str=); print join(" / ", @ary); # This doesnt work. (as you pointed out) my @ary = split (" ",$_) while (); print join(" / ", @ary); #Nor does this either my (@ary); @ary = split (" ",$str) while (my $str=); print join(" / ", @ary);