chromatic has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re2: Inner Subroutines, mod_perl, and Segfaults
by tye (Sage) on Jan 25, 2001 at 23:59 UTC | |
by tye (Sage) on Jan 27, 2001 at 00:07 UTC | |
by tye (Sage) on Nov 02, 2006 at 07:02 UTC | |
|
(tye)Re: Inner Subroutines, mod_perl, and Segfaults
by tye (Sage) on Jan 25, 2001 at 23:38 UTC | |
by chromatic (Archbishop) on Jan 25, 2001 at 23:53 UTC | |
by tilly (Archbishop) on Jan 26, 2001 at 06:37 UTC | |
|
Re: Inner Subroutines, mod_perl, and Segfaults
by MeowChow (Vicar) on Jan 27, 2001 at 00:05 UTC |