Help for this page

Select Code to Download


  1. 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.)
    
  2. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    print "$_\n" for split ( "Hello World" );
     
    print "$_\n" for split /\s+/, "Hello World";
    
  3. 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.
    
  4. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    my $count = 0;
    for ( sort keys %{ $_ } ) { print $count++, ":$_{$_} $_\n" };