Hardy Merrill [mailto:[EMAIL PROTECTED] wrote:

> By saying "...of course the app bombs" isn't very descriptive.  You need
> to be a
> little more clear about just what the problem is and what is happening.

Indeed.


> Javier, I might be way off here, but looks to me like this statement:
> 
>    my($sql) = "UPDATE GLOBALSettings SET Lang = '$::lang_code'";
> 
> has $::lang_code in *single quotes* - I'm not sure about this in this
> context, but won't the single quotes will keep $::lang_code from being
> interpolated?

The string is a double-quoted string.  The single-quotes are just literal
characters inside a double-quoted string.  They have no special meaning
here.


This is still good advice though:

> Why not make that
> 
>   my($sql) = 'UPDATE GLOBALSettings SET Lang = ?';
> 
> and then add the $::lang_code as a parameter in the execute, like
> this:
> 
>      if ($criteria) {
>           my $rc = $sth->execute ( $::lang_code, $criteria ) or
>                               &Error("Unable to execute statement",
> "$sql with criteria $criteria");
>      } else {
>       my $rc = $sth->execute ($::lang_code) or
>                               &Error("Unable to execute statement",
> $sql);
>      }


Ronald


Reply via email to