[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: minivend->perl->eval
****** message to minivend-users from mikeh@minivend.com ******
Quoting Larry Leszczynski (larryl@furph.com):
> ****** message to minivend-users from Larry Leszczynski <larryl@furph.com> ******
>
> Hi Alexander -
>
> > my $string =<<'EOF';
> > [sql array]select refathlets,refevents,refsports,sortname from
> > products[/sql]
> > EOF
> >
> > my @arry = eval $string;
>
> If you are using the [sql] tag inside a [perl] tag, you do not need to do
> eval yourself, because MiniVend will interpolate it for you.
>
> I am not sure, but I think you are meaning to do something like this:
>
> [perl interpolate=1]
> my @arry = qw( [sql array]select refathlets,refevents,refsports,sortname
> from products[/sql] );
I never even thought of doing that, but of course Larry is correct. One
small change to the code:
my $ary = [sql array] select code,price
from products
where category = 'Impressionists'[/sql];
That will equal:
my $ary = [ ['00-341', '40000000'], ['00-342', '20000000'] ];
(assuming the price is kept a string, which I recommend).
>
> foreach ( @arry ) {
> ... do some stuff ...
> }
Then it becomes:
for (@$ary) {
... do some stuff ...
}
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
"The U.S. Senate -- white 131 Willow Lane, Floor 2 | || _ \
male millionaires working Oxford, OH 45056 | || |_) |
for YOU!" -- Dave Barry <mikeh@minivend.com> |___| _ <
513.523.7621 FAX 7501 |_| \_\
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list