.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Msgcat 3pm" .TH Msgcat 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Locale::Msgcat \- Perl extension for blah blah blah .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Locale::Msgcat; \& \& $cat = new Locale::Msgcat; \& \& $rc = $cat\->catopen(name, oflag); \& $msg = $cat\->catgets(set_number, message_number, string); \& $rc = $cat\->catclose(); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" The \fBLocale::Msgcat\fR module allows access to the message catalog functions which are available on some systems. A new Locale::Msgcat object must first be created for each catalog which has to be open at a given time. .PP The \fBcatopen\fR operation opens the catalog whose name is given as argument. The oflag can be either 0 or NL_CAT_LOCALE (usually 1) which is the recommended value. .PP The \fBcatgets\fR message retrieves message_number for the set_number message set, and if not found returns string. .PP The \fBcatclose\fR function should be used when access to a catalog is not needed anymore. .SH EXAMPLES .IX Header "EXAMPLES" .Vb 1 \& use Locale::Msgcat; \& \& $cat = new Locale::Msgcat; \& unless ($cat\->catopen("whois.cat", 1)) { \& print STDERR "Can\*(Aqt open whois catalog.\en"; \& exit(1); \& } \& printf "First message, first set : %s\en", $cat\->catgets(1, 1, "not found"); \& unless ($cat\->catclose()) { \& print STDERR "Can\*(Aqt close whois catalog.\en"; \& exit(1); \& } .Ve .PP The above example would print the first message from the first message set found in the whois catalog, or if not found it would print "not found". .SH AUTHOR .IX Header "AUTHOR" Christophe Wolfhugel, wolf@pasteur.fr .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBcatopen\fR\|(3), \fBcatclose\fR\|(3), \fBcatgets\fR\|(3), \fBperl\fR\|(1).