[ic] globalsub broken when implementing CommonAdjust

Ed LaFrance interchange-users@interchange.redhat.com
Tue Jan 22 12:26:01 2002


At 09:57 PM 01/21/2002 -0700, you wrote:
>Hello List,
>
>I've been using a global sub for quite a while to do some math and return
>the percentage of savings a user is getting on a product:
>
>GlobalSub <<EndOfSub
>sub you_save_percent {
>my($retail, $price) = @_;
>my($yousave);
>if (($retail > 0)&&($price > 0))
>{
>$yousave = ((1-($price/$retail))*100)+.5001;
>$yousave = int($yousave);
>$yousave .= "\%";
>}
>   return $yousave;
>}
>EndOfSub
>
>This is called like this:
>[perl arg=sub interpolate=1] you_save_percent ([item-field retail],
>[item-field price])[/perl]

Shouldn't that be [perl arg=subs global=1 interpolate=1]?

- Ed L.


>I just switched to using CommonAdjust because I want to take advantage of
>the price group feature.  For some reason this broke the Global Sub.
>
>I get this error:
>
>63.14.69.58 zAD78XEt:63.14.69.58 - [21/January/2002:20:31:41 -0800] catalog
>/store/catalog/BP050.html Safe: Unable to create sub named
>"*MVSAFE55822::you_save_percent" at (eval 433) line 1.
>
>  you_save_percent (14.95, 12.70)
>
>
>Any ideas?
>
>-Russ
>
>_______________________________________________
>interchange-users mailing list
>interchange-users@interchange.redhat.com
>http://interchange.redhat.com/mailman/listinfo/interchange-users

===============================================================
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
===============================================================