Now mod_perl uses eval() tricks to compile the whole application into a handler subroutine, so all of the top-level sub declarations will be at least one level lower.sub getWorkspace { my ($self, $WHERE, $TYPE) = @_; $TYPE = $self->getType($TYPE) if ($TYPE); sub cmpval { my ($val1, $val2) = @_; if (ref($val1) eq 'Node') { $val1 = $$val1{node_id}; }; if (ref($val2) eq 'Node') { $val2 = $$val2{node_id}; } $val1 eq $val2; } foreach my $node (keys %{ $this->{workspace}{nodes} }) { my $N = $this->getNode($node); my $match = 1; foreach (keys %$WHERE) { $match = 0 unless cmpval($$N{$_}, $$WHERE{$_}); } push @results, $N if $match; } return \@results; }
My question is, am I right to be suspicious of the inner subroutine (cmpval())? Is there a limit as to how far you can nest these things before you run into a stack limit?
It's easy enough to move the inner sub outside, or create an anonymous sub out of it. Can anyone confirm my suspicions?
In reply to Inner Subroutines, mod_perl, and Segfaults by chromatic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |