Removed an unused variable. Made the selecting array always return an array even in scalar context. This makes using it in |if| statements a lot easier.

This commit is contained in:
ian%hixie.ch 2001-12-26 19:03:07 +00:00
Родитель bdc0b5ca1d
Коммит 4adb0e69e5
1 изменённых файлов: 1 добавлений и 6 удалений

Просмотреть файл

@ -51,17 +51,12 @@ sub AUTOLOAD {
my $self = shift;
my $name = $AUTOLOAD;
$name =~ s/^.*://o; # strip fully-qualified portion
my @allResults;
foreach my $object (@$self) {
my $method = $object->can($name);
if ($method) {
my @result = &$method($object, @_);
if (@result) {
if (wantarray) {
return @result;
} else {
return $result[0];
}
return @result;
}
} else {
confess("Failed to find method or property '$name' in object '$object' of MagicSelectingArray '$self', aborting"); # die with stack trace