[ic] Cart programming question

Mike Heins interchange-users@interchange.redhat.com
Sun Mar 17 15:12:01 2002


Quoting Steffen Dettmer (steffen@dett.de):
> * Mike Heins wrote on Sun, Mar 17, 2002 at 14:06 -0500:
> > Quoting Steffen Dettmer (steffen@dett.de):
> > > Can't use string ("[{"price_group" => "general","mv") as an ARRAY
> > > ref while "strict refs" in use at
> > > /usr/local/interchange-4.8.2/lib/Vend/Interpolate.pm line 1268.
> > 
> > It won't do that if the string is formatted properly.
> 
> Why that? The perl manual pages are pretty clear about it. In
> strict refs, strings are only treated as scalars and cannot be
> dereferenced. The Data::Dumper manpage suggests also to "eval"
> the string data to get a real reference.

No. I don't know if you know what is happening here.

[pragma safe_data]
[calc]
	my $ref = [data table=foo col=bar key=baz];
[/calc]

The data tag is interpolated before the Perl code is evaluated.
If the string coming from the data tag is correct, the code
will be valid.

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

For a successful technology, reality must take precedence over public
relations, for Nature cannot be fooled. -- Dick Feynman