Help for this page

Select Code to Download


  1. or download this
        my $x = "a b c d e f g";
        my $y = (split /\s+/, $x, 2)[0];
    
  2. or download this
        split /PATTERN/, EXPR, LIMIT
    
    ...
        If LIMIT is specified and positive, splits into no
        more than that many fields (though it may split into
        fewer).