[ic] Perl CGI module (was: Safe error in payment module)

Mike Heins mike at perusion.com
Thu Nov 15 22:35:08 UTC 2012


Quoting Dan Bergan (dan at berganconsulting.com):
> On Thu, Nov 15, 2012 at 2:58 PM, Josh Lavin <josh at perusion.net> wrote:
> > Quoting Dan Bergan (dan at berganconsulting.com):
> >> I was having success with the Net::Braintree module, except for the
> >> method that used the CGI module.  So, I created a simple usertag that
> >> caused the same error:
> >>
> >> UserTag test_cgi Order todo
> >> UserTag test_cgi addAttr
> >> UserTag test_cgi Routine <<EOR
> >> use CGI;
> >> sub {
> >>   my ($todo, $opt) = @_;
> >>
> >>   my $query_string = $CGI::query_string;
> >>   ::logError("test_cgi tag:".__LINE__.": query_string = $query_string");
> >>
> >>   my $query = CGI->new($query_string);
> >>   return $query->Vars;
> >> }
> >> EOR
> >>
> >> I placed this usertag in a page called "test.html" and called the
> >> page: /cgi-bin/champnew/test.html?test=1
> >>
> >> Error in the global IC error log:
> >>
> >>  champnew /cgi-bin/champnew/test.html Died in server spawn: Undefined
> >> subroutine CGI::delete
> >> >  at (tag 'test_cgi') line 9.
> >
> > Well, I don't know what that error means, but I don't think you need to
> > reference the CGI module in your IC tag. IC provides access to CGI
> > parameters already.
> >
> > Look at any .pm file in lib/Vend/, and search for "%CGI::values" for an
> > example.
> >
> 
> Well, that's the issue... I do need the CGI module.  (The above code
> was just to demonstrate the error.)
> 
> The Net::Braintree module that I'm using for the payment module uses CGI.

Then you are out of luck. You are not in CGI.

> 
> It looks like I could hack the Net::Braintree module to use the
> interchange $CGI values, but I would rather keep the code vanilla so I
> can upgrade in the future, if necessary.
> 
> I'm not a perl expert, so maybe I'm grasping at straws here, but it is
> a namespace issue?  I grepped through the source for CGI, and I found
> this in Server.pm in the "reset_vars" subroutine:
> 
> package CGI;
> reset 'A-Z';
> reset 'a-z';

All that is academic. You are not living in CGI-land.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.253.4194  <mike at perusion.com>

I don't want to get to the end of my life and find I have just
lived the length of it. I want to have lived the width of it as
well. -- Diane Ackerman



More information about the interchange-users mailing list