diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2004-12-02 09:42:09 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2004-12-02 09:42:09 +0000 |
commit | c590ed51732cd3a2e9b1a5139baeff37c2932a36 (patch) | |
tree | 22107341bc49715aa54107b2842f279e6388463f /bin | |
parent | 1fba322e748e2492737f2c41079ca36abd0af94b (diff) | |
download | ATCD-c590ed51732cd3a2e9b1a5139baeff37c2932a36.tar.gz |
ChangeLogTag: Thu Dec 2 09:42:12 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/PerlACE/ConfigList.pm | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/bin/PerlACE/ConfigList.pm b/bin/PerlACE/ConfigList.pm index f2546d844d9..74e530b1c94 100644 --- a/bin/PerlACE/ConfigList.pm +++ b/bin/PerlACE/ConfigList.pm @@ -9,7 +9,7 @@ use FileHandle; my @new_argv = (); for(my $i = 0; $i <= $#ARGV; ++$i) { - if ($ARGV[$i] eq '-Config') { + if ($ARGV[$i] eq '-Config') { if (defined $ARGV[$i + 1]) { push @PerlACE::ConfigList::Configs, $ARGV[++$i]; } @@ -25,7 +25,7 @@ for(my $i = 0; $i <= $#ARGV; ++$i) { @ARGV = @new_argv; -sub new () +sub new () { my $self = {}; @{$self->{MY_CONFIGS}} = @PerlACE::ConfigList::Configs; @@ -78,17 +78,20 @@ sub load ($) while (<$fh>) { chomp; - if (/^\s*$/ || /^#/) { - next; + if (/^\s*$/ || /^#/) { + next; } # compress white space s/\s+/ /g; my $entry = ''; my $configs = ''; - + ($entry, $configs) = split /:/; + # remove trailing white spaces + $entry =~ s/\s+$//; + push @{$self->{ENTRIES}}, $entry; if (defined $configs) { @{$self->{CONFIGS}->{$entry}} = split (" ", $configs); @@ -98,7 +101,7 @@ sub load ($) $fh->close (); } -sub valid_entries () +sub valid_entries () { my $self = shift; my @entries = (); @@ -118,7 +121,7 @@ sub list_configs () my $list = ''; foreach my $entry (@{$self->{ENTRIES}}) { - + foreach my $config (@{$self->{CONFIGS}->{$entry}}) { $config =~ s/!//g; if ($allconfigs{$config} != 1) { @@ -133,7 +136,7 @@ sub list_configs () sub dump () { - my $self = shift; + my $self = shift; print "============================================================\n"; print "Config\n"; @@ -152,4 +155,4 @@ sub dump () print "============================================================\n"; } -1;
\ No newline at end of file +1; |