[ILUG] Re: [Webdev] Perl references
Niall O Broin
niall at magicgoeshere.com
Mon Sep 25 18:09:17 IST 2000
On Mon, Sep 25, 2000 at 03:43:35PM +0100, Kathryn Cassidy wrote:
> I'm constructing a sql statement and need to quote the above moo
> variable, so I do
>
> $dbh->quote($$params{'moo'})
>
> which evaluates to null.
I had some sever hairiness a while ago with variables passed to $dbh->quote
- generated quite a bit of heat here and elsewhere, and some little light
:-) I was trying to pass $2 AFAIR (which should be OK, because $2 was OK at
point of entry, but by the time $dbh->quote had finished with it, it was NULL.
The workaround was to copy $2 into another variable before calling
$dbh->quote so in you case, just try
$thing_to_be_quoted = $$params{'moo'};
and then use
$dbh->quote($thing_to_be_quoted)
No guarantees, but it can't hurt to try (although $$params{'moo'} should
just evaluate to a scalar, so . . .)
Regards,
Niall
More information about the ILUG
mailing list