- or download this
my @interesting = ();
while(<DATA>) {
...
push @interesting, $1 if m/^(?:attribute|value): (.*)$/;
}
my %attributes = @interesting; # magic
- or download this
my %attributes = grep { length } map { m/^(?:attribute|value): (.*)$/
+and $1 } <DATA>;
- or download this
my %dataObjs = ();
...
push @interesting, $1 if m/^(?:attribute|value): (.*)$/;
}
$dataObjs{$dataObj} = { @interesting };
- or download this
my %dataObjs = ();
...
$att = $1 if m/^attribute:\s+(.+)/;
$dataObjs{$dataObj}->{$att} = $1 if /^value:\s+(.+)/;
}