[ic] many warehouses shipping

Rick Eicher II interchange-users@interchange.redhat.com
Tue Apr 16 16:12:01 2002


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?

Thanks for your time,
rick eicher II
www.pbol.net