Help for this page

Select Code to Download


  1. or download this
    open(my $fh, "tempfile") or die("ack - $!");
    chomp( my $header = <$fh> );
    ...
        push @{ $info{$name} }, @rows;
    }
    close $fh;
    
  2. or download this
    open(my $fh, ">", "output") or die("ack - $!");
    print $fh $header;
    ...
        $info{$a}->[ $cols{z} ] <=> $info{$b}->[ $cols{z} ]
    } keys %info;
    close $fh;
    
  3. or download this
    my(@list) = "foo bar baz" =~ m< (?: (\w+) \s* )+ >x;
    print "@list";
    ...
    
    baz
    # not - foo bar baz
    
  4. or download this
    my(@list) = "foo bar baz" =~ m< (\w+) [ ]? >xg;
    print "@list";
    ...
    __output__
    
    foo bar baz