H0tc@xe has asked for the wisdom of the Perl Monks concerning the following question:
# Extract objects from config. my @objects = map { /^(object|object-group) (network|service) +([A-Za-z0-9-_]+)$/ ? $3 : () } @{ $configref }; # Remove objects from config. @config = grep { $_ !~ /^(object|object-group) / } @config; # Find unused object references. foreach my $object (@objects) { if (!grep { $_ =~ /$object/ } @config) { elsif grep { /^PPS/ } @objects; { print $fp "object-group service $object \n"; else print $fp "object-group network $object \n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: elsif greping
by stevieb (Canon) on Sep 26, 2015 at 00:15 UTC | |
by H0tc@xe (Initiate) on Sep 26, 2015 at 01:43 UTC | |
by Anonymous Monk on Sep 26, 2015 at 01:57 UTC | |
|
Re: elsif greping ( perlintro, perlsyn )
by Anonymous Monk on Sep 26, 2015 at 00:44 UTC | |
by stevieb (Canon) on Sep 26, 2015 at 00:50 UTC |