in reply to Re: Split ( ) is Giving Me a Splitting Headache
in thread Split ( ) is Giving Me a Splitting Headache

The key here is what happens when you perform the incorrect usage of split:
my @parts = split( "Hello World" ); # generates warning print "Parts: " . scalar(@parts) . "\n"; # prints "Parts: 0" for( @parts ){ # never enters this loop since the array is empty print "$_\n"; }
The warning you saw on your first loop was generated by the split statement, not the print statement. As demonstrated above, the print statement never gets executed because the loop is never entered.

Hope that helps make some sense of what's happening,
-- Brian