sub test { local $\="NEWLINE" if 1; if (1) { local $\; } print "text:"; } #### # 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); #### my @words = map { split " ",$_ } ; print "@words\n"; #### $/=" "; my @words=;