[ic] Interesting Failure Reading Scratch Variables from Session

Jon Jensen interchange-users@icdevgroup.org
Thu Jul 18 13:36:01 2002


On Thu, 18 Jul 2002, John Beima wrote:

> > > What is wrong with the original Perl tag is the Perl tag dose not return
> > > anything unless it is told to return it. His use of the tag is wrong.
> > 
> > The last value is the return value. You may want to check the Interchange
> > source code to find the proof that your statement is incorrect. :)
> 
> I was going from the documentation and all the examples in it, since the
> tag is well documentate. So maybe it is time you updated it then. Or
> possibly fixed the tag, since I KNOW first hand, that what you are
> saying does not reliably work.

I'm not talking about behavior specific to Interchange. Perl subs always
return the last value in the block if no explicit return is made, and
Interchange [perl] blocks evaluate as Perl subs. That's all.

For example, the old Minivend 3 docs say:

    Perl code can be directly embedded in MiniVend pages. The code is
    specified as [perl arguments*] any_legal_perl_code [/perl]. The value
    returned by the code will be inserted on the page.

There are examples of return-less code all throughout the Interchange docs
that use [perl] in exactly this manner (and [calc] which works the same
way) -- grep through and you will find them.

If you have a working example to demonstrate [perl] blocks don't work that
way, or would like to show me IC documentation that says something to the
contrary, I'll be glad to take a look at it.

Jon