Akopia Akopia Services

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

Re: [mv] GlobalSubs handled differently in MV 4.x than in 3.x



******    message to minivend-users from Randy Moore <ramoore@axion-it.net>     ******

At 5/5/00 10:07 AM , you wrote:
>******    message to minivend-users from Mike Heins 
><mikeh@minivend.com>     ******
>
>Quoting Randy Moore (ramoore@axion-it.net):
> >
> > Hi,
> >
> > I just wanted to give a warning to anyone converting existing stores from
> > MV 3.x to MV 4.x about GlobalSubs.
> >
> > GlobalSubs are not supposed to be subject to Safe checks, and so, can do
> > unSafe things.
> >
> > In MV 3.x, you could call a Globalsub from embedded Perl code and it would
> > be allowed to do unSafe operations, as expected.
> >
> > But, under MV 4.x, this is no longer true.  If you call your GlobalSub 
> from
> > embedded Perl code, it can NOT do unSafe operations.
> >
> > I was able to get around this problem by replacing my GlobalSubs with
> > globally defined (in minivend.cfg) UserTags.  Since these are not called
> > from within Perl, they are still exempt from Safe checking.
> >
> > If someone can explain the technical details as to why this changed (or
> > correct any misconceptions I have above), I'd love to know.  It may 
> make it
> > easier to know when and if GlobalSubs can still be used for unSafe 
> operations.
> >
> > Hope this warning helps someone.
>
>Helps me. 8-) I had no idea...it is not something I normally do so
>I didn't encounter this.
>
>But my understanding is that it should work. There are a couple of
>exceptions, though.
>
>     - If you are using SQL databases and don't have Safe::Hole installed,
>     then you will have problems.
>
>     - If the GlobalSub calls any database routines (directly or
>     indirectly) and the database table has not been shared with
>     tables="products arbitrary" or the like, then it will fail.

Hi Mike,

I don't think any of these exceptions apply to what I was doing.  I posted 
the full details, including the code for my globalsub earlier (you can see 
it here:
http://www.minivend.com/minivend/minivend-list/2000/msg03274.html).

The problem seemed to be with object creation.  I was getting errors like:

host2.axion-it.com TGsTUTp7:axion-it.com - [26/April/2000:21:46:25 -0400]
order /cgi-bin/order/process.html Safe: Can't locate object method "new"
via package "Mail::Sender" at (eval 12) line 12.

Let me know if you are interested in any other details.

Randy Moore
Axion Information Technologies, Inc.

email     ramoore@axion-it.net
phone   301-408-1200
fax        301-445-3947
-
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


Search for: Match: Format: Sort by: