Unless I've misunderstood what is going on I think there are a few problems with this global:
my @catids = shift;
my $catid = pop @catids;
$catid = pop @$catid;
return $catid;
}
my @catids = shift would only fill @catids with one element everytime as shift uses scalar context and an array is a list. You'd need:
my @catids = @_;
You are then grabbing the last element of @catids and storing it as $catid. Are all elements in @catids array references?....if not then:
$catid = pop @$catid will cause a fatal error.
If I've misunderstood then sorry
Code:
sub { my @catids = shift;
my $catid = pop @catids;
$catid = pop @$catid;
return $catid;
}
my @catids = shift would only fill @catids with one element everytime as shift uses scalar context and an array is a list. You'd need:
my @catids = @_;
You are then grabbing the last element of @catids and storing it as $catid. Are all elements in @catids array references?....if not then:
$catid = pop @$catid will cause a fatal error.
If I've misunderstood then sorry