diff options
| author | fukachan <fukachan> | 2001-11-08 03:37:33 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-11-08 03:37:33 +0000 |
| commit | 6b1a73ddc0e891e02cd9be33032ba7e2f1d176b4 (patch) | |
| tree | b025d2fa58481e82bf7dc30b55e20056dd8057ce /fml/lib/FML/Command.pm | |
| parent | 1989b33189f39763ec131dc3f93d0385e771a0fb (diff) | |
| download | fml8-6b1a73ddc0e891e02cd9be33032ba7e2f1d176b4.tar.gz fml8-6b1a73ddc0e891e02cd9be33032ba7e2f1d176b4.tar.bz2 fml8-6b1a73ddc0e891e02cd9be33032ba7e2f1d176b4.zip | |
defined() check for $command_args
Diffstat (limited to 'fml/lib/FML/Command.pm')
| -rw-r--r-- | fml/lib/FML/Command.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fml/lib/FML/Command.pm b/fml/lib/FML/Command.pm index 95c2c063..45e80e35 100644 --- a/fml/lib/FML/Command.pm +++ b/fml/lib/FML/Command.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Command.pm,v 1.11 2001/10/14 00:56:54 fukachan Exp $ +# $FML: Command.pm,v 1.12 2001/10/17 10:24:25 fukachan Exp $ # package FML::Command; @@ -59,10 +59,14 @@ sub DESTROY { ;} sub AUTOLOAD { my ($self, $curproc, $command_args) = @_; - my $mode = $command_args->{ 'command_mode' } =~ /admin/i ? 'Admin' : 'User'; + my $mode = 'User'; return if $AUTOLOAD =~ /DESTROY/; + if (defined $command_args->{ 'command_mode' }) { + $mode = $command_args->{'command_mode'} =~ /admin/i ? 'Admin' : 'User'; + } + my $comname = $AUTOLOAD; $comname =~ s/.*:://; my $pkg = "FML::Command::${mode}::${comname}"; |
