MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: Safe: Missing $ on loop variable error mv3.10



Hi Ryan -

> [perl arg=scratch interpolate=1]
> 	$Safe{'scratch'}->{'proactive'} .= '[page [loop-code]][loop-field
> description][/page] for your [item-description]<BR>' unless
> $Safe{'scratch'}->{'proactiveuniq'} =~ '[loop-code]';
> 	$Safe{'scratch'}->{'proactiveuniq'} .= '[loop-code],';
> 	return '';
> [/perl]

You're running into trouble because you're using single quotes and your
[loop-field description] has a single quote in it, so your code:
  '[page [loop-code]][loop-field description][/page] 
                                           for your [item-description]<BR>'
interpolates into:
  '<a href="http://...stuff...">Flippin' Jig Head</a> for your Crawdad<BR>'
                                       ^
                                       this single quote is the problem

This is a very common Perl programming mistake, especially in MiniVend
because you tend to forget (at least I do) that the interpolated database
values might contain single or double quotes.  Instead you should use
something like: 

  q{[page [loop-code]][loop-field description][/page]
                                 for your [item-description]<BR>}

or if you need to interpolate Perl variables inside use something like:

  qq{[page [loop-code]][loop-field description][/page]
                                 for your $somevar<BR>}


Larry Leszczynski
larryl@furph.com
--
  furph, Inc.	WWW/Unix/Windows Solutions	734-513-7763 (voice)
info@furph.com	   http://www.furph.com		734-513-7759 (FAX)



Search for: Match: Format: Sort by: