- or download this
#!/usr/bin/perl -w
use strict;
...
my %map;
$map{$1} = $2 while s/^.*? (\S+)="([^"]+)"//g;
print "$_: $map{$_}\n" for keys %map;
- or download this
grade: 7
teacher: Priyanka
remarks: Good,Verygood,bext,excellent
- or download this
print map {"$1: $2\n" if /(\S+)="([^"]+)"/} split;