Skip Menu |
 

This queue is for tickets about the Locales CPAN distribution.

Report information
The Basics
Id: 46387
Status: resolved
Priority: 0/
Queue: Locales

People
Owner: Nobody in particular
Requestors: ckuskie [...] sterling.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05
Fixed in: 0.07



Subject: bare use line causes Apache to have fits
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1019
Download (untitled) / with headers
text/plain 1019b
For some reason that I don't fully understand, Locales is having problems when used with apache/mod_perl. I wrote a script with this line: use Locales::Country; and got back the following error message: is unsupported, trying en at /usr/local/lib/perl5/site_perl/5.10.0/Locales/Base.pm line 122. Error loading WebGUI::Shop::ShipDriver::UPS: Could not load WebGUI::Shop::ShipDriver::UPS because Unable to loa d ::en : Can't locate /en.pm in @INC (@INC contains: /data/WebGUI/lib /usr/local/lib/perl5/site_perl/5.10.0/i38 6-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread- multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.10.0/i386-linux-thread-mult i /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl . /etc/httpd) at (eval 1099) line 1. Note that there didn't seem to be a locale in there. The same code from a test script worked fine. I had to change the use line to: use Locales::Country qw/ en /; to make it work.
X-Ymail-Osg: N7lkXewVM1n.lHtomgRcgsuY2QBma0SqjQ7Q_N.U342yI1OtA3CPBAydVfH_QjZveZOJbGcG4dIIUvQXVyzTvZAseCyOr7DY4pSLROXf3KowAbSmsNmfUXo0HgxJRB43yqO.NQ1tXemQQJ1tVfy2uN3ouAqeRmkOxuBoonBGq41rJNWf.aAcCdQ_onr3R3K97xWYlGZCocljA3dqgQWbVMA.iRplGoJJqwthUa0vj08gO9.HIcuiKysS6_F0S8uhuOZBdP_Q6Me2YWxbyUpFfQr_5l0QiNnx4gtjhG7KMxbTqRw6GFV3
MIME-Version: 1.0 (Apple Message framework v930.3)
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-19052-1243379145-208.46387-4-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.930.3)
References: <RT-Ticket-46387 [...] rt.cpan.org> <rt-3.6.HEAD-19052-1243379145-208.46387-4-0 [...] rt.cpan.org>
X-Yahoo-Newman-Property: ymail-3
Message-ID: <A5CA2E0E-521E-4247-9214-F748909787F2 [...] simplemood.com>
Content-Type: text/plain; charset="utf-8"; delsp="yes"; format="flowed"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id EED3B4D8162 for <bug-Locales [...] rt.cpan.org>; Tue, 26 May 2009 19:18:01 -0400 (EDT)
Received: (qmail 10398 invoked by uid 103); 26 May 2009 23:18:01 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 26 May 2009 23:18:01 -0000
Received: from smtp114.sbc.mail.mud.yahoo.com (HELO smtp114.sbc.mail.mud.yahoo.com) (68.142.198.213) by 16.mx.develooper.com (qpsmtpd/0.80) with SMTP; Tue, 26 May 2009 16:17:53 -0700
Received: (qmail 90743 invoked from network); 26 May 2009 23:17:49 -0000
Received: from unknown (HELO ?192.168.1.106?) (webmaster [...] 70.140.36.232 with plain) by smtp114.sbc.mail.mud.yahoo.com with SMTP; 26 May 2009 23:17:49 -0000
Delivered-To: cpan-bug+Locales [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46387] bare use line causes Apache to have fits
Return-Path: <webmaster [...] simplemood.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Locales [...] rt.cpan.org
Date: Tue, 26 May 2009 18:17:48 -0500
X-Spam-Level: *
To: bug-Locales [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Dan Muey <webmaster [...] simplemood.com>
RT-Message-ID: <rt-3.6.HEAD-19052-1243379891-199.46387-0-0 [...] rt.cpan.org>
Content-Length: 1584
Download (untitled) / with headers
text/plain 1.5k
thanks, I'll have a look ASAP, probably has to do with an eval On May 26, 2009, at 6:05 PM, Colin Kuskie via RT wrote: Show quoted text
> Tue May 26 19:05:44 2009: Request 46387 was acted upon. > Transaction: Ticket created by ckuskie@sterling.net > Queue: Locales > Subject: bare use line causes Apache to have fits > Broken in: 0.05 > Severity: Important > Owner: Nobody > Requestors: ckuskie@sterling.net > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=46387 > > > > For some reason that I don't fully understand, Locales is having > problems when used with apache/mod_perl. > > I wrote a script with this line: > > use Locales::Country; > > and got back the following error message: > > is unsupported, trying en at > /usr/local/lib/perl5/site_perl/5.10.0/Locales/Base.pm line 122. > Error loading WebGUI::Shop::ShipDriver::UPS: Could not load > WebGUI::Shop::ShipDriver::UPS because Unable to loa > d ::en : Can't locate /en.pm in @INC (@INC contains: /data/WebGUI/lib > /usr/local/lib/perl5/site_perl/5.10.0/i38 > 6-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 > /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread- > multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl > /usr/lib/perl5/5.10.0/i386-linux-thread-mult > i /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl . /etc/httpd) at > (eval > 1099) line 1. > > Note that there didn't seem to be a locale in there. The same code > from > a test script worked fine. > > I had to change the use line to: > > use Locales::Country qw/ en /; > > to make it work.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-19052-1243425746-1822.46387-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1301
Download (untitled) / with headers
text/plain 1.2k
Show quoted text
> Locales is having problems when used with apache/mod_perl. > > I wrote a script with this line: > > use Locales::Country; > > and got back the following error message: > > is unsupported, trying en at > /usr/local/lib/perl5/site_perl/5.10.0/Locales/Base.pm line 122. > Unable to load ::en : Can't locate /en.pm in @INC (@INC contains: /data/WebGUI/lib > > I had to change the use line to: > > use Locales::Country qw/ en /; > > to make it work.
It must be an oddity with caller() in a mod_perl environment. What it boils down to is this pseudo example:: my $caller = caller; ... my $module = $caller . "::$locale"; unless ( eval "require $module;" ) { ... What really doesn't make sense is why giving it a locale makes caller() work like you expect. (ultimately resulting in setLocale(), where this is happening, getting passed an argument of 'en' instead of calculating one when no arg is given) I'm new to this module still so please bear with me as I sort through it :) Could you put some debug info logging into your Locales/Base.pm and post the output back here? maybe something like this: sub setLocale { my ($self, $locale) = @_; my $caller = ($self->{_module}) ? $self->{_module} : caller ; use Data::Dumper;$log->debug(Dumper([$caller, [caller()], \@_])); thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.