teamassociated has asked for the wisdom of the Perl Monks concerning the following question:
__CURRENT_DESIRED_OUT_:
0x00000010 => Available r2wpar_r1.610b24bfc20149ff17976c9c63f1a261 Available r2wpar_w1.2458bd43d1f3116046180e5e0e361ca7 0x0000001e => Available sapepp00_r1.2915b2239121c2eac69518efed0fbbe4 Available sapepp00_r2.88bdab9aa8334093e1bceaf393f8f88f Available sapepp00_e1.c330a9065d0c3243fe13016d5932c146 Available sapepp00_e2.7b1627b996222f9c74ab8393059788a9 Available sapepp00_p1.761becb64095de97b26e35d419ea2bcb 0x00000012 => Available sapepq00_r1.eacbba530a846f2e40315e892fb66532 Available sapepq00_r2.6d869942baf6fe277f2709fe604bea6d Available sapepq00_e1.0b6ed1a6d9bf9298d7465255b3ab33b4 Available sapepq00_e2.8e55566cd9b5fb35623cd958b4a317d4 Available sapepq00_p1.6beaabc01ab495cf83a138a1ba954d55 __END_OUT__ __RAW_INPUT__ SVSA Physloc Client Pa +rtition ID --------------- -------------------------------------------- --------- +--------- vhost43 U8284.22A.21AAF9V-V1-C33 0x0000000 +8 VTD vtscsi71 Status Available LUN 0x8100000000000000 Backing device twcsapsmmdb1_r1.5c3d6fbe5fa85c487f817a4ae464da0b Physloc Mirrored N/A VTD vtscsi94 Status Available LUN 0x8200000000000000 Backing device twcsapsmmdb1_s1.00dffa2880291e123ca1283ea3f26f2d Physloc Mirrored N/A SVSA Physloc Client Pa +rtition ID --------------- -------------------------------------------- --------- +--------- vhost9 U8284.22A.21AAF9V-V1-C16 0x0000001 +0 VTD vtscsi110 Status Available LUN 0x8100000000000000 Backing device r2wpar_r1.610b24bfc20149ff17976c9c63f1a261 Physloc Mirrored N/A VTD vtscsi111 Status Available LUN 0x8200000000000000 Backing device r2wpar_w1.2458bd43d1f3116046180e5e0e361ca7 Physloc Mirrored N/A __END_RAW__ use strict; use warnings; use File::Find; use Mail::Mailer; use Test::More tests => 2; use vars ('*name', '*dir', '*prune'); *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune; $| = 1; my $regex = qr/\-$|^svsa.*$|^mirrored.*|^physloc.*|^$/i; my (%lsmap15a,$lsm15a,$client15a,$status15a,$bdev15a,$lsmap15a,$lsm15A +); open (LSMAP15A, "+< $lsmap15a") or die $!; while ( $lsm15a = (<LSMAP15A>) ) { next if $lsm15a =~ m/$regex/; ($lsm15A = $lsm15a) =~ s/\-//g; if ( $lsm15a =~ m/vtopt\d+/i ) { my $skip = 3; <LSMAP15A> while $skip-- >0 and not eof LSMAP15A; next; } if ( $lsm15a =~ /^vhost\d+\s+\w+\.\d+\w\.\w+\-\w+\-\w+\s+(0x\w+$)/ +i ) { $client15a = $1; } if ( $lsm15a =~ /^status\s+(\w+$)/i ) { $status15a = $1; push ( @{$lsmap15a{$client15a}}, $status15a ); next; } if ( $lsm15A =~ /^backing\sdevice\s+(\w+_\w+\.\w+$)/i ) { $bdev15a = $1; push ( @{$lsmap15a{$client15a}}, $bdev15a ); next; } } print RLOG "\n"; Test::More->builder->output( $runlog ); Test::More->builder->failure_output( $errlog ); is_deeply(\%lsmap15a, \%lsmap15b, 'vios15a-vios15b-map-compare' ); -s $errlog ? __mailme($contacts, $mesg, $errlog) : sleep 1; ### print w/no sort ### #for my $clientdataA ( sort keys %lsmap15a ) { # print RLOG join ("\n\n", "$clientdataA\t==> #\n\t@{$lsmap15a{$clientdataA}}\n\n"); #} ### print with sort ### foreach( sort { $a->[1] cmp $b->[1] } map { [ $_, $lsmap15a{$_}->[1] ] } keys %lsmap15a) { print join "\n", $_->[0],' => ',@{$lsmap15a{$_->[0]} }; print "\n\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sorted HoA, now what?
by u65 (Chaplain) on Nov 19, 2015 at 23:43 UTC | |
by teamassociated (Sexton) on Nov 20, 2015 at 13:32 UTC | |
by u65 (Chaplain) on Nov 20, 2015 at 22:04 UTC | |
by stevieb (Canon) on Nov 20, 2015 at 23:08 UTC | |
by u65 (Chaplain) on Nov 20, 2015 at 23:39 UTC | |
| |
by teamassociated (Sexton) on Nov 21, 2015 at 17:41 UTC | |
|
Re: sorted HoA, now what?
by u65 (Chaplain) on Nov 21, 2015 at 19:22 UTC | |
by teamassociated (Sexton) on Nov 23, 2015 at 15:26 UTC | |
|
Re: sorted HoA, now what?
by u65 (Chaplain) on Nov 21, 2015 at 13:57 UTC | |
|
Re: sorted HoA, now what?
by u65 (Chaplain) on Nov 24, 2015 at 12:28 UTC |