Help for this page

Select Code to Download


  1. or download this
    my $LINE_PATTERN = qr{
        ([^:]+)  # capture everything before ...
        :\s*     # the colon and any newline or other whitespace,
    ...
    while ($app_text =~ /$LINE_PATTERN/g) {
        print "$1: $2\n";
    }
    
  2. or download this
    my %value_of = $app_text =~ /$LINE_PATTERN/g;
    
    while (my ($field, $value) = each %value_of) {
        print "$field: $value\n";
    }