Limo has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use File::Find; find (\&diag, $directory); sub diag { @diaglist = `cat $_ |grep SLOT`; my $device = $_; foreach $rtr_diag(@diaglist) { unless ($rtr_diag =~ m/Clock|Switch|Power|Processor/) { push @{$slots{$device}}, $rtr_diag; } } foreach $device (sort keys %slots) { my $diag_string = join "", @{$slots{$device}}; print "$device:\n"; print "===========================\n"; print "$diag_string\n\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Nesting/Loop/Print problem
by little (Curate) on Oct 05, 2000 at 21:24 UTC | |
by Limo (Scribe) on Oct 05, 2000 at 21:28 UTC | |
by little (Curate) on Oct 05, 2000 at 21:39 UTC | |
|
RE: Nesting/Loop/Print problem
by Limo (Scribe) on Oct 05, 2000 at 21:09 UTC | |
by chromatic (Archbishop) on Oct 05, 2000 at 21:28 UTC | |
by Limo (Scribe) on Oct 05, 2000 at 21:35 UTC |