Skip Menu |

This queue is for tickets about the Locale-Codes CPAN distribution.

Report information
The Basics
Id: 66327
Status: resolved
Priority: 0/
Queue: Locale-Codes

People
Owner: Nobody in particular
Requestors: STEFFENW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 3.16
Fixed in: (no value)



Subject: can not call all_currency_codes
use strict; use warnings; use Locale::Codes; print all_currency_codes(LOCALE_CURR_ALPHA); returns: Bareword "LOCALE_CURR_ALPHA" not allowed while "strict subs" in use at ... ****************** use strict; use warnings; use Locale::Codes; print all_currency_codes()" returns: Undefined subroutine &main::all_currency_codes called at ...
You're misunderstanding how to use the module. If you use the following: use Locale::Currency; print all_currency_codes(LOCALE_CURR_ALPHA); it will work as desired. The modules designed for actual use are Locale::Country, Locale::Currency, Local::Language, and Locale::Script. These are wrapped up in the Locale-Codes distribution. The Locale::Codes module is included but isn't actually designed to be used... it contains a bunch of core routines that are used by the modules listed above. I'll modify the documentation to make this clearer.
Subject: Re: [rt.cpan.org #66327] Resolved: can not call all_currency_codes
Date: Wed, 02 Mar 2011 21:23:18 +0100
To: bug-Locale-Codes [...] rt.cpan.org
From: "Steffen Winkler" <steffen.winkler [...] gmx.net>
Thank you, the problem was, you have documented subroutines in some helper modue and not in the module I should use. Please write what every module is for and link to the module I should use. I was really confused and my colleague had no idea to help me. Thank you for the quick answer. --Steffen -- Schon gehört? GMX hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://www.gmx.net/de/go/toolbar
On Wed Mar 02 15:23:28 2011, steffen.winkler@gmx.net wrote: Show quoted text
> Thank you, > > the problem was, you have documented subroutines in some helper modue > and not in the module I should use. Please write what every module > is for and link to the module I should use. I was really confused > and my colleague had no idea to help me. > > Thank you for the quick answer. > > --Steffen >
The reason for this (which I actually feel is fairly well documented in the manual) is that the interface for each of the Locale modules (Locale::Country, Locale::Currency, Locale::Language, and Locale::Script) are completely identical to each other. In other words, they ALL have functions: code2XXX XXX2code etc. If I were to maintain the description separately, I'd be maintaining 4 different copies, identical to each other in all but name. Rather than do that, I chose to maintain one copy in Locale::Codes. I may revisit the docs to try to make that clearer, but I'm not going to switch back to maintaining 4 copies of the docs... too error prone.