[ic] Running perl code as part of an order route...

Mike Heins interchange-users@interchange.redhat.com
Sun Feb 10 19:22:00 2002


Quoting Malcolm Webb (mawebb@rocketmail.com):
> Hi-
> 
> I've read through the doc, and have tried to do this several different
> ways, but I am not able to get it working.
> 
> What I would like to do is kick off a perl script to do some processing
> as part of an order (after credit card has been approved). This
> processing involves making calls to the local file system.
> 
> >From looking at the doc, it seems as though I would need to create a
> custom "commit" order route and include it in the list of routes to get
> executed as part of an order.
> 
> I did this, but I keep getting this error message:
> 
> <path to>/process.html Safe: Illegal division by zero at (eval 234)
> line 1.
> 
> >From further reading through the doc, it appears that this error is
> related to the limitations imposed by the Safe module, and the way to
> work around this is to create a Global subroutine.
> 
> So I created one.
> 

But how did you call it? [perl subs=1] sub(); [/perl] will not
work...

The best way is to make it a Global UserTag instead, and
call it with $Tag->yoursub().

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Experience is what allows you to recognize a mistake the second
time you make it. -- unknown