From c77b3d5c4e8832b4bc3ca66c0ef23c1427b046bd Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 19 Nov 2002 07:08:04 +0000 Subject: previous example in perldoc was buggy; put one that really works --- perl-install/security/msec.pm | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/perl-install/security/msec.pm b/perl-install/security/msec.pm index 2c56197e9..347976406 100644 --- a/perl-install/security/msec.pm +++ b/perl-install/security/msec.pm @@ -12,21 +12,28 @@ msec - Perl functions to handle msec configuration files =head1 SYNOPSYS + #!/usr/bin/perl + + use strict; + use lib qw(/usr/lib/libDrakX); require security::msec; - - my $msec = new msec; - - $secure_level = get_secure_level; - - @functions = $msec->get_functions; - foreach @functions { %options{$_} = $msec->get_function_value($_) } - foreach @functions { %defaults{$_} = $msec->get_function_default($_) } - foreach @functions { $msec->config_function($_, %options{$_}) } - - @checks = $msec->get_default_checks; - foreach @checks { %options{$_} = $msec->get_check_value($_) } - foreach @checks { %defaults{$_} = $msec->get_check_default($_) } - foreach @checks { $msec->config_check($_, %options{$_}) } + + my $msec = new security::msec; + + my $secure_level = $msec->get_secure_level; + + my (%options, %defaults); + + my @functions = $msec->get_functions(); + + foreach (@functions) { $options{$_} = $msec->get_function_value($_) } + foreach (@functions) { $defaults{$_} = $msec->get_function_default($_) } + foreach (@functions) { $msec->config_function($_, $options{$_}) } + + my @checks = $msec->get_default_checks; + foreach (@checks) { $options{$_} = $msec->get_check_value($_) } + foreach (@checks) { $defaults{$_} = $msec->get_check_default($_) } + foreach (@checks) { $msec->config_check($_, $options{$_}) } =head1 DESCRIPTION -- cgit v1.2.1