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
Aaron Trevena
February 25, 2013 18:37
[perl #116919] Examples in I18N::Langinfo pod won't run due to fatal errors
Message ID:
# New Ticket Created by  "Aaron Trevena" 
# Please include the string:  [perl #116919]
# in the subject line of all future correspondence about this issue. 
# <URL: >


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 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)



Aaron J Trevena, BSc Hons
LAMP System Integration, Development and Consulting

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About