in reply to How to do simple select with Net::MySQL

Looks like a quoting issue. Take a look at how the q and qq operators handle text. What you want to do is interpolate (substitute) the value of $workspace into the string. q will quote verbatim, whereas qq will permit interpolation.

Try changing

q{select * from workspace where name = '$workspace'}
to
qq{select * from workspace where name = '$workspace'}

Hope that helped,
-v

"Perl. There is no substitute."

Replies are listed 'Best First'.
Re^2: Now to do simple select with Net::MySQL
by Anonymous Monk on Sep 15, 2004 at 05:53 UTC

    Interpolating variables in a SQL query is a NO-NO.

    Use placeholders. Don't give bad advice.

      I've never before heard that interpolating variables in SQL is bad advice - why is that bad advice??

      It's true that using placeholders is desirable for a number of reasons, but interpolating variables in SQL is not *bad*.