On Tue, Jun 16, 2009 at 12:06:54PM -0400, MK wrote:
> I've been frustrated with this all morning.  I have a particular spot 
> where (presumably) mason is not filling in a variable correctly and so 
> a DBI->do call is coming back with *no* return value (it is not undef, 
> either).  Here's some prelimary stuff that all works fine:

If possible, don't show snippets; show your whole component so we can see
everything in context.

The biggest problem is that you're opening yourself up to SQL injection
attacks.  title=";drop table docdirs;", for example.  Use bind variables
instead.

You also didn't say exactly what SQL you *did* end up running, just "nothing"
and "didn't work".  Precision would help here.

> I suspect this has something to do with the order in which Mason 
> performs substitutions, but in any case it seems like a real "bug" or 
> something to me; the variable is valid and the syntax is identical to 
> the syntax I am using elsewhere.  There is no SQL error in the http 
> logs.

Mason doesn't "fill in" variables in Perl blocks.  Perl's normal string
interpolation does that for your heredocs.

Also, using $r is a variable is probably a bad idea, since that's the global
variable that stores the Apache request object.

> If I can't find a better solution, I will just have to work around this 
> by breaking the page into seperate components -- since all my other db 
> insert calls work, the only thing I see different in this page is the 
> length and number of (potential) db operations, etc.  Since only one of 
> the potential operations will take place, I can't really blame DBI and 
> believe the page is just "too much" for mason to correctly parse*.  
> That is not a very satisfying solution!

It's also pretty unlikely, since everything you've pasted is Perl.  Does it
change if you use a <%perl> block instead of prefixing each line with %?

hdp.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to