- or download this
If EXPR is omitted, splits the $_ string. If PATTERN is also omitted,
+ splits on whitespace (after skipping any leading whitespace). Anyth
+ing matching PATTERN is taken to be a delimiter separating the fields
+. (Note that the delimiter may be longer than one character.)
- or download this
#!/usr/bin/perl
use warnings;
...
print "$_\n" for split ( "Hello World" );
print "$_\n" for split /\s+/, "Hello World";
- or download this
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.
- or download this
#!/usr/bin/perl
use warnings;
...
my $count = 0;
for ( sort keys %{ $_ } ) { print $count++, ":$_{$_} $_\n" };