Trying to migrate a complex script from a standard CGI context to a mod_perl
context, and am having a hell of a time. The latest problem is that I have a
call to GCI::Utils->getSelfRefUrlWithQuery() which causes a crash.
In an attempt to isolate the problem, I wrote this short script which does
nothing more than call that method:
--------------
#!perl -w
use strict;
print "Content-type: text/plain\r\n\r\n";
use CGI::Utils;
my $self_url = '';
print "Before calling get_self_ref_url_with_query()\n";
#no strict;
my $cgi_utils = CGI::Utils->new();
$self_url = $cgi_utils->getSelfRefUrlWithQuery();
#$self_url = $cgi_utils->get_self_ref_url_with_query();
#$self_url = CGI::Utils->getSelfRefUrlWithQuery();
#$self_url = CGI::Utils->getSelfRefUrlWithQuery();
#use strict;
---------------
When I run it, I get the following error:
[Thu Dec 01 17:04:21 2011] [error] Can't use string
("HTML::Mason::Commands::m") as a SCALAR ref while "strict refs" in use at
C:/Perl/site/lib/CGI/Utils.pm line 203.\n
If I comment out the call to getSelfRefUrlWithQuery(), then the script runs
fine.
I have tried calling that method in four different ways (as CGI::Utils-> or
$cgi_utils->, with the underscore or hungarian notation variants), with or
without 'no strict'. All of those combinations fail.
I tried running this script as a ModPerl::Registry or a ModPerl::PerlRun mode,
and neither ones work.
Is getSelfUrlWithQuery() a method that can't be used in a mod_perl context? If
so, how can I get the URL fo the current script call?
Thx
Alain Désilets