in reply to How do I execute an array element?
Depending on the logic of the rest of your code, you may be better off storing the actual arguments instead of references to them:push @incl, [ \&CreateLoginForm, \$page, \$error ]; # later on: foreach my $incl ( @incl ) { my ($sub, @args) = @$incl; $page .= $sub->(@args); }
But I can't determine that from what you've told us. It might avoid surprises though.push @incl, [ \&CreateLoginForm, $page, $error ];
Question: is the $page you push into @incl the same as the $page you use in the foreach loop?
|
|---|