in reply to Re: Capturing SQL errors in Perl
in thread Capturing SQL errors in Perl

But you are passing them inside single quotes, and what goes inside single quotes is not interpolated.

Wrong. The single quotes are inside a double-quoted string.

The original version is not best practice, but it won't fail until one of the interpolated variables contains an embedded quote.

my $name = 'Larry'; my $sql = "Insert into Users (name) values ('$name')"; print $sql; # Insert into Users (name) values ('Larry')