Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Brother chromatic, I am not having much success reproducing this. If I create this simple script it works. However, if I try it in an application I am working on it doesn't. After a few hours of frustration I have decided to punt. Help please? Here is a chunk of my code. I am pulling the string out of the database instead of arbitrarily setting it:
my $WhereVal = $Return->[0]->{WhereVal}; my $Temp2 = 2; warn $WhereVal; eval "\$Temp = qq/$WhereVal/"; warn $Temp;
The result is that the eval fails. The log shows:
c.AppModule=m.AppModule and m.Application=$Temp2 at (eval 43) line 19. Use of uninitialized value in concatenation (.) at (eval 43) line 20. Use of uninitialized value in warn at (eval 43) line 21.
The complete subroutine, less gratuitous debugging code:
sub VWP_RunQuery { my ($QueryRef, @Params) = @_; if ($QueryRef) { VWP_Log(5, "Running query $QueryRef..."); my $stt = "select q.FromVal, q.OrderVal, q.SelectVal, q.WhereVal " + . "from VWPQuery q, VWPQueryRef qr where q.Query=qr.Query and " . "qr.DBType = ? and qr.Query = ?"; my $Return = VWP_SQL($stt, ($Session::DBType, $QueryRef)); if (@$Return) { my $OrderVal = $Return->[0]->{OrderVal}; $stt = "select " . $Return->[0]->{SelectVal} . " from " . $Return->[0]->{FromVal}; if ($Return->[0]->{WhereVal}) { my $WhereVal; eval "\$WhereVal = qq/$Return->[0]->{WhereVal}/"; $stt = $stt . " where " . $WhereVal; } if ($OrderVal) { if (($OrderVal =~ /order by/) || ($OrderVal =~ /ORDER BY/)) { $stt = $stt . " " . $OrderVal; } else { $stt = $stt . " order by " . $OrderVal; } } return VWP_SQL($stt, @Params); } } VWP_StrMessage(1, 13, $QueryRef); }

In reply to Re: Double Interpolation of a String by nontrivial
in thread Double Interpolation of a String by chromatic

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (9)
    As of 2014-12-26 09:33 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (171 votes), past polls