• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!@PERL@
2# Example for use of GNU gettext.
3# This file is in the public domain.
4#
5# Source code of the Perl program, using the Locale::Messages API.
6
7use Locale::Messages qw (textdomain bindtextdomain gettext);
8use POSIX qw(getpid);
9
10binmode STDOUT, ':raw'; # Needed to make it work in UTF-8 locales in Perl-5.8.
11
12sub _ ($) { &gettext; }
13
14textdomain "hello-perl";
15bindtextdomain "hello-perl", "@localedir@";
16
17print _"Hello, world!";
18print "\n";
19printf _"This program is running as process number %d.", getpid();
20print "\n";
21