Hi Y'all,
On Sat, Apr 22, 2000 at 12:17:11AM +0100, Niall wrote:
> I suppose this more properly belongs on c.l.p or somesuch, but as I know a
> few of you are using Perl and MySQL I thought I'd try here first. I'm
> encountering a strange error when trying to populate a MySQL table with code
> like this
>> $Filename =~ m-(\d+ +)(.*)(/WHATEVER)-;
>> # $title = $2;
>> $values = join ",", $dbh->quote($Description),
> $dbh->quote(substr($Description, 0, 50)), $dbh->quote($2),
> $dbh->quote($Keywords), $dbh->quote($UnixPath),
> $dbh->quote($MacPath), $dbh->quote($Volume);
I imagine DBI's quote() method uses regular expressions and as such
kills whatever value you might have in $2. Probably.
What happens if you do a...
sub please_explain {
my $arg = shift;
print STDERR "Everywhere you look, all you see is `$arg'.\n";
return "";
}
$values = join ",", $dbh->quote($Description),
$dbh->quote(substr($Description, 0, 50)),
please_explain($2),
$dbh->quote($2),
$dbh->quote($Keywords), $dbh->quote($UnixPath),
$dbh->quote($MacPath), $dbh->quote($Volume);
Wesley.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!