MiniVend Akopia Services

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

Re: Does AllowGlobal cause Subs to malfunction?



******    message to minivend-users from mikeh@minivend.com     ******

Quoting Gerard Olszowiec (gerard@entitysoftware.com):
> 
> Hi all:
> 
> I have found that when I include the AllowGlobal declaration in minivend.cfg
> existing Subs in catalog.cfg malfunction.  I have been able to reproduce
> this problem easily.  When I put
> 
> AllowGlobal usx00
> 
>  in minivend.cfg, all but the last previously existing and correctly working
> Subs in catalog.cfg return $0.00.  These are the Subs I use to calculate
> shipping costs, and are referenced through shipping.asc.  Defining a global
> sub in minivend.cfg does not seem to have any effect on the malfunction.  I
> first thought that my global sub was to blame so I removed it.  Currently I
> do not have a global sub defined, not even the test global sub.  I find that
> it is a simple case of "If I don't use AlllowGlobal usx00 my shipping is
> calculated correctly.  If I use it only the last shipping cost defined is
> correct".  I say 'defined' here because only the last defined Sub will
> return a non-zero value.  I have experimented with moving the order of the
> Sub definitions and it is always the last one to be defined that works,
> while all other return zero, regardless of the order in SHIPMODE.
> 
> Anyone else have this problem, or know of a fix?  Getting a global sub to
> work is turning into a vocation for me.  8-)

When you use Global, full Perl 'use strict' checking applies. That
is undoubtedly your problem.

You might try putting "no strict;" at the top of the sub and
seeing if it works.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
Fast, reliable, cheap.              131 Willow Lane, Floor 2  | ||  _ \
Pick two and we'll talk.            Oxford, OH  45056         | || |_) |
 -- unknown                         <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


Search for: Match: Format: Sort by: