Change 11211 by jhi@alpha on 2001/07/08 13:53:38
Fix I18N::Langinfo nits noticed but Philip Newton.
Affected files ...
... //depot/perl/ext/I18N/Langinfo/Langinfo.pm#2 edit
... //depot/perl/ext/I18N/Langinfo/Langinfo.t#3 edit
... //depot/perl/pod/perllocale.pod#31 edit
Differences ...
==== //depot/perl/ext/I18N/Langinfo/Langinfo.pm#2 (text) ====
Index: perl/ext/I18N/Langinfo/Langinfo.pm
--- perl/ext/I18N/Langinfo/Langinfo.pm.~1~ Sun Jul 8 08:00:05 2001
+++ perl/ext/I18N/Langinfo/Langinfo.pm Sun Jul 8 08:00:05 2001
@@ -11,8 +11,9 @@
our @ISA = qw(Exporter DynaLoader);
+our @EXPORT = qw(langinfo);
+
our @EXPORT_OK = qw(
- langinfo
ABDAY_1
ABDAY_2
ABDAY_3
@@ -112,14 +113,17 @@
=head1 DESCRIPTION
-The langinfo() function queries various locale information that
-can be used to localize output and user interfaces.
+The langinfo() function queries various locale information that can be
+used to localize output and user interfaces. The langinfo() requires
+one numeric argument that identifies the locale constant to query:
+if no argument is supplied, C<$_> is used. The numeric constants
+appropriate to be used as arguments are exportable from I18N::Langinfo.
-The following example will import the langinfo() function itself
-(implicitly) and (explicitly) three constants to be used as arguments
-to langinfo(): a constant for the abbreviated first day of the week (the
-numbering starts from Sunday 1) and two more constant for the affirmative
-and negative answers for a yes/no question in the current locale.
+The following example will import the langinfo() function itself and
+three constants to be used as arguments to langinfo(): a constant for
+the abbreviated first day of the week (the numbering starts from
+Sunday = 1) and two more constants for the affirmative and negative
+answers for a yes/no question in the current locale.
use I18N::Langinfo qw(langinfo ABDAY_1 YESSTR NOSTR);
@@ -127,9 +131,10 @@
print "$abday_1? [$yesstr/$nostr] ";
-In other words, in the "C" (or English) locale the above will probably print:
+In other words, in the "C" (or English) locale the above will probably
+print something like:
- Sun? [y/n]
+ Sun? [yes/no]
The usually available constants are
@@ -162,7 +167,7 @@
for the affirmative and negative responses and expressions, and
- ERA ERA_D_FMT ERA_D_T_FMT ETA_T_FMT
+ ERA ERA_D_FMT ERA_D_T_FMT ERA_T_FMT
for the Japanese Emperor eras (naturally only defined under Japanese locales).
==== //depot/perl/ext/I18N/Langinfo/Langinfo.t#3 (text) ====
==== //depot/perl/pod/perllocale.pod#31 (text) ====
Index: perl/pod/perllocale.pod
--- perl/pod/perllocale.pod.~1~ Sun Jul 8 08:00:05 2001
+++ perl/pod/perllocale.pod Sun Jul 8 08:00:05 2001
@@ -427,25 +427,28 @@
}
print "\n";
-=head2 I18::Langinfo
+=head2 I18N::Langinfo
Another interface for querying locale-dependent information is the
I18N::Langinfo::langinfo() function, available at least in UNIX-like
systems and VMS.
-The following example will import the langinfo() function itself
-(implicitly) and (explicitly) three string constants: a string for the
-abbreviated first day of the week (the numbering starts from Sunday =
-1) and two strings for the affirmative and negative answers for a
-yes/no question in the current locale.
+The following example will import the langinfo() function itself and
+three constants to be used as arguments to langinfo(): a constant for
+the abbreviated first day of the week (the numbering starts from
+Sunday = 1) and two more constants for the affirmative and negative
+answers for a yes/no question in the current locale.
+
+ use I18N::Langinfo qw(langinfo ABDAY_1 YESSTR NOSTR);
- use I18N::Langinfo qw(ABDAY_1 YESSTR NOSTR);
+ my ($abday_1, $yesstr, $nostr) = map { langinfo } qw(ABDAY_1 YESSTR NOSTR);
- print ABDAY_1, "? [", YESSTR, "/", NOSTR, "] ";
+ print "$abday_1? [$yesstr/$nostr] ";
-In other words, in the "C" (or English) locale the above will print:
+In other words, in the "C" (or English) locale the above will probably
+print something like:
- Sun? [y/n]
+ Sun? [yes/no]
See L<I18N::Langinfo> for more information.
End of Patch.