in reply to Re: Split ( ) is Giving Me a Splitting Headache
in thread Split ( ) is Giving Me a Splitting Headache
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.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"; }
|
|---|