#!/usr/bin/perl use strict; use Data::Dumper; my %record; my $name; while (<DATA>) { if ( /Name: / ... /\n\n/ ) { s/Name:\s*(.*)// and $name = $1; my ($key, $val) = split( /\s+/ ); push( @{ $record{$name}->{$key} }, $val ); } } print Dumper \%record; __DATA__ Name: LUN 120 DB CloneGroupUid: 50:06:01:60:BC:E0:26:09:03:00:00:00:00:00:00:00 InSync: Yes ...
In reply to Re: Command output into a hash of hash
by bichonfrise74
in thread Command output into a hash of hash
by mrras25
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |