Text::MessageFormat - Language neutral way to display messages


  use Text::MessageFormat;

  my $form = Text::MessageFormat->new('The disk "{1}" contains {0} file(s).');
  print $form->format(3, 'MyDisk');

  # output: The disk "MyDisk" contains 3 file(s).


Text::MessageFormat is a Perl version of Java's java.text.MessageFormat and aims to be format-compatible with that class.

MesageFormat provides a means to produce concatenated messages in language-neutral way. Use this to construct messages displayed for end users.

See Data::Properties for java.util.Properties porting.


  • Following FormatElements are all NOT implemented yet. Currently they interpolate exactly same as just {0}.

      {0,choice,0#are no files|1#is one file|1<are {0,number,integer} files}

    Patches are always welcome!


Tatsuhiko Miyagawa <>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO Data::Properties