summaryrefslogtreecommitdiff
path: root/gettext-tools/examples/hello-perl/hello-2.pl.in
diff options
context:
space:
mode:
Diffstat (limited to 'gettext-tools/examples/hello-perl/hello-2.pl.in')
-rw-r--r--gettext-tools/examples/hello-perl/hello-2.pl.in15
1 files changed, 15 insertions, 0 deletions
diff --git a/gettext-tools/examples/hello-perl/hello-2.pl.in b/gettext-tools/examples/hello-perl/hello-2.pl.in
new file mode 100644
index 0000000..afb9b6a
--- /dev/null
+++ b/gettext-tools/examples/hello-perl/hello-2.pl.in
@@ -0,0 +1,15 @@
+#!@PERL@
+# Example for use of GNU gettext.
+# This file is in the public domain.
+#
+# Source code of the Perl program, using the Locale::TextDomain API.
+
+use Locale::TextDomain ("hello-perl" => "@localedir@");
+use POSIX qw(getpid);
+
+binmode STDOUT, ':raw'; # Needed to make it work in UTF-8 locales in Perl-5.8.
+
+print __"Hello, world!";
+print "\n";
+print __x ("This program is running as process number {pid}.", pid => getpid());
+print "\n";