xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/examples/hello-perl/hello-1.pl.in (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#!@PERL@
2# Example for use of GNU gettext.
3# Copyright (C) 2003 Free Software Foundation, Inc.
4# This file is in the public domain.
5#
6# Source code of the Perl program, using the Locale::Messages API.
7
8use Locale::Messages qw (textdomain bindtextdomain gettext);
9use POSIX qw(getpid);
10
11binmode STDOUT, ':raw'; # Needed to make it work in UTF-8 locales in Perl-5.8.
12
13sub _ ($) { &gettext; }
14
15textdomain "hello-perl";
16bindtextdomain "hello-perl", "@localedir@";
17
18print _"Hello, world!";
19print "\n";
20printf _"This program is running as process number %d.", getpid();
21print "\n";
22