in reply to Parsing output from a 'system' call into objects?
Very similar to anonymonk's post, but without the module (just got sidetracked before I could post the solution):
use warnings; use strict; use Data::Dumper; my @lines = split /\n/, `cat data.txt`; my %out; for (@lines){ next if /CoID:/; my ($co, $type, $state, $id) = split; next if ! $id; next if $type ne 'A'; $out{$id}->{CoID} = $co; $out{$id}->{State} = $state; } print Dumper \%out;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing output from a 'system' call into objects?
by choroba (Cardinal) on Feb 22, 2017 at 04:04 UTC | |
|
Re^2: Parsing output from a 'system' call into objects?
by huck (Prior) on Feb 21, 2017 at 20:34 UTC | |
by stevieb (Canon) on Feb 21, 2017 at 20:54 UTC |