Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Command output into a hash of hash

by bichonfrise74 (Vicar)
on Nov 20, 2009 at 01:05 UTC ( [id://808312]=note: print w/replies, xml ) Need Help??


in reply to Command output into a hash of hash

Another way...
#!/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 ...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://808312]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-24 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found