[ic] many warehouses shipping

Ed LaFrance interchange-users@interchange.redhat.com
Tue Apr 16 16:22:42 2002


At 03:11 PM 04/16/2002 -0500, you wrote:
>My global sub is as follows:
>
>###########################################
>
>UserTag  ship  Order  mode origin zip weight country
>UserTag  ship  Routine <<EOR
>sub {
>         my( $mode, $zip, $weight, $country) = @_;
>         $country        = $::Values->{$::Variable->{UPS_COUNTRY_FIELD}}  if
>! $country;
>         $zip            = $::Values->{$::Variable->{UPS_POSTCODE_FIELD}} if
>! $zip;
>         $country = uc $country;
>
>         my $shipping = 0;
>         my %origins;
>         $origins{$_->{origin}} = $_->{weight} for (@{$Carts->{main}});
>
>::logGlobal("calling with: " . join("|", $mode, $origin, $zip, $weight,
>$country));
>
>         foreach (keys %origins){
>            $shipping += $Tag->ups_query({
>                mode => $_,
>                origin => $origin,
>                zip => $zip,
>                country => $country,
>                weight => $origins{$_},
>            });
>        }
>
>         return $shipping;
>}
>EOR
>###########################################################
>
>After restarting the server I see in the logs this:
>
>...<snip>.....
>- - - [16/April/2002:16:22:04 -0500] - - UserTag 'ship' subroutine failed
>compilation:
> >
> >        Global symbol "$origin" requires explicit package name at (eval
>113) line 11, <GLOBAL> line 27.
> > Global symbol "$origin" requires explicit package name at (eval 113) line
>16, <GLOBAL> line 27.
> >
> > In line 27 of the configuration file 'usertag/ship.tag':
> > UserTag  ship  Routine <<EOR
> >
>- - - [16/April/2002:16:22:04 -0500] - - Interchange V4.8.3
>...<snip>...
>
>Any ideas?
>

Yep - problem right here:

::logGlobal("calling with: " . join("|", $mode, $origin, $zip, $weight,
$country));
                                                 ^^^^^^^

This is the first mention of $origin in your code. You need to fix this if 
it is a typo, or otherwise define $origin with 'my' before you can use it.

- Ed L.

>

===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================