From 6b1a73ddc0e891e02cd9be33032ba7e2f1d176b4 Mon Sep 17 00:00:00 2001 From: fukachan Date: Thu, 8 Nov 2001 03:37:33 +0000 Subject: defined() check for $command_args --- fml/lib/FML/Command.pm | 8 ++++++-- 1 file 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}"; -- cgit v1.2.1