[ic] Help with overriding item_subtotal

Tim Nelson interchange-users@icdevgroup.org
Mon Aug 26 13:55:02 2002


I am trying to override "item_subtotal" in Data.pm using a GlobalSub.

The code is as follows:

GlobalSub <<EOS
   sub override_item_subtotal {
      package Vend::Data;
      sub item_subtotal {
       ::logGlobal ("CALLED the overrride");
         return 1.23;
      }
      package Vend::Interpolate;
      *item_subtotal = \&Vend::Data::item_subtotal;
   }
EOS

My override seems to be called in some places and others not.  In
Interpolate.pm
sub subtotal uses "Vend::Data::item_subtotal" and calls the override just
fine,
where as apply_discount and iterate_hash_list calls "item_subtotal" and
results in
the original item_subtotal being called.

Thanks.

Tim Nelson
Enterprise Computer Systems, Inc.