This isn't specifically a mod_perl question, but something I'm having
trouble doing within mod_perl code. I'm far from a Perl expert, but I
try...
I've got a hash called %post which contains submitted form info and a
variable $db which is the result of a DBI->connect call. I need to take
these 2 values and pass them into a subroutine. I've tried something like
&join($db, %post);
sub join
{
my ($db, %post) = shift (@_);
...
foreach $key (keys(%post))
{
...
}
}
and
&join ($db, \%post);
sub join
{
my ($db, $post) = shift (@_);
foreach $key (keys(%$post))
{
%$post{$key} = $db->quote("%$post{$key}");
}
}
Using CGI-based Perl I suppose I could just use local() instead of my()
to avoid having to pass arguments, but didn't think this would be
advisable in mod_perl code.
How can I manage to do what I'm trying to do?
Alec