summaryrefslogtreecommitdiffstats
path: root/perl-install/security
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-02-17 23:23:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-02-17 23:23:34 +0000
commit57adb120500fb37ea9e97a2eff3e4d3cd7feec21 (patch)
treeca575878f4c7b308b93f2b4d353245afab59fed9 /perl-install/security
parentcf7ebb5eccbf4d15f7d1677bb7edba75d52b8b10 (diff)
downloaddrakx-backup-do-not-use-57adb120500fb37ea9e97a2eff3e4d3cd7feec21.tar
drakx-backup-do-not-use-57adb120500fb37ea9e97a2eff3e4d3cd7feec21.tar.gz
drakx-backup-do-not-use-57adb120500fb37ea9e97a2eff3e4d3cd7feec21.tar.bz2
drakx-backup-do-not-use-57adb120500fb37ea9e97a2eff3e4d3cd7feec21.tar.xz
drakx-backup-do-not-use-57adb120500fb37ea9e97a2eff3e4d3cd7feec21.zip
replace %level_list with level_list() so that N("...") is called at runtime
instead of compile-time
Diffstat (limited to 'perl-install/security')
-rw-r--r--perl-install/security/level.pm26
1 files changed, 13 insertions, 13 deletions
diff --git a/perl-install/security/level.pm b/perl-install/security/level.pm
index 368ab4c5a..234fb2d4b 100644
--- a/perl-install/security/level.pm
+++ b/perl-install/security/level.pm
@@ -5,20 +5,20 @@ use common;
use run_program;
-my %level_list = (
- 0 => N("Welcome To Crackers"),
- 1 => N("Poor"),
- 2 => N("Standard"),
- 3 => N("High"),
- 4 => N("Higher"),
- 5 => N("Paranoid"),
- );
-
-sub to_string { $level_list{$_[0]} }
-sub from_string {
- my %sec_levels = reverse %level_list;
- $sec_levels{$_[0]} || 2;
+sub level_list {
+ (
+ 0 => N("Welcome To Crackers"),
+ 1 => N("Poor"),
+ 2 => N("Standard"),
+ 3 => N("High"),
+ 4 => N("Higher"),
+ 5 => N("Paranoid"),
+ );
}
+
+sub to_string { +{ level_list() }->{$_[0]} }
+sub from_string { +{ reverse level_list() }->{$_[0]} || 2 }
+
sub get_string { to_string(get() || 2) }
sub get_common_list { map { to_string($_) } (2, 3, 4) }