[ic] perl sub in ups style lookup

Joshua Rusch interchange-users@icdevgroup.org
Wed May 7 13:39:01 2003


Hi,

I found this tidbit in the documentation, and would love if someone
could provide a simple example since I can't seem to get the syntax
quite right.

"A simple shipping cost qualification can be appended to a UPS lookup.
If any additional parameters are present after the five usual ones used
for UPS lookup, they will be interpreted as a Perl subroutine call. The
syntax is the same as if it was encased in the tag [perl sub] [/perl],
but the following substitutions are made prior to the call:"

I've tried lines like:

upsg    UPS Ground      weight  0       150     u Ground [default zip
117] 0 0 "return @@COST@@*1.10"

upsg    UPS Ground      weight  0       150     u Ground [default zip
117] 0 0 @@COST@@*1.1

Basically, I want to use a UPS style lookup and increase the shipping by
10%. I've tried setting adder, but then realized that's only for fixed
values.

Am I going about this the wrong way? I know there is a handling feature
I can play around with, but this seemed simplest since it's a 10%
increase everywhere.

Thanks!
Josh