If EXPR is omitted, splits the $_ string. If PATTERN is also omitted, splits on whitespace (after skipping any leading whitespace). Anything matching PATTERN is taken to be a delimiter separating the fields. (Note that the delimiter may be longer than one character.)
####
#!/usr/bin/perl
use warnings;
use strict;
print "$_\n" for split ( "Hello World" );
print "$_\n" for split /\s+/, "Hello World";
##
##
Here are the places where Perl will assume $_ even if you don't use it:
__snip__
- The default iterator variable in a foreach loop if no other variable is supplied.
##
##
#!/usr/bin/perl
use warnings;
use strict;
use Data::Dumper;
print "\n\n";
print "\$_ = $_\n";
print "\n\n";
for ( 1 .. 10 ) { print "\$_ = $_\n" }
print "\n\n";
print $_ for {};
print "\n\n";
print Dumper $_ for {};
print "\n\n";
my $count = 0;
for ( sort keys %{ $_ } ) { print $count++, ":$_{$_} $_\n" };