The Perl 5 module Locale::Msgfmt does the same thing as msgfmt from GNU gettext-tools, except this is pure Perl.