develooper Front page | perl.perl5.porters | Postings from February 2013

[perl #116919] Examples in I18N::Langinfo pod won't run due to fatal errors

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
February 26, 2013 03:05
Subject:
[perl #116919] Examples in I18N::Langinfo pod won't run due to fatal errors
Message ID:
rt-3.6.HEAD-31961-1361847921-691.116919-15-0@perl.org
On Mon Feb 25 02:52:23 2013, aaron.trevena@gmail.com wrote:
> Hi,
> 
> There is something wrong in the pod for I18N::Langinfo, seems to have
> not changed since at least 5.10
> 
> If you actually run the example in the pod :
> 
>    use I18N::Langinfo qw(langinfo ABDAY_1 YESSTR NOSTR);
>    my ($abday_1, $yesstr, $nostr) = map { langinfo } qw(ABDAY_1 YESSTR
> NOSTR);
>    print "$abday_1? [$yesstr/$nostr] ";
> 
> You will get a fatal runtime error :
> Not enough arguments for I18N::Langinfo::langinfo at langinfo.pl line
> 2, near "langinfo }"
> 
> Doesn't seem much point in details which perl compiler options etc I
> have, as that example will never work unless perl or I18N::Langinfo
> has had a significant change in behaviour since perl 5.10
> 
> Fix is to remove the qw string quoting and refer to variables instead
> of strings and then pass them as an argument to langinfo :
> 
>     map { langinfo($_) } (DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6,
> DAY_7)
> 
> regards,
> 
> Aaron
> 
> 
> 

I have attached which corrects the POD with code that executes.

Does it suffice?  Please review.

Thank you very much.
Jim Keenan



---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=116919

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About