Sign in to PrePAN

UML::PlantUML::Encoder Provides PlantUML Language Encoding



use UML::PlantUML::Encoder qw(encode_p);

my $encoded = encode_p(qq{
   Alice -> Bob: Authentication Request
   Bob --> Alice: Authentication Response

print "$encoded";
print "$encoded";
print "$encoded";
print "$encoded";


  • Plantuml is a library for generating UML diagrams from a simple text markup language.

  • PlantUML defines a standardized way to encode diagram text description to a simple string of characters that contains only digits, letters, underscore and minus character.

  • The goal of such an encoding is to facilitate communication of diagrams through URL (see

  • This encoding includes compression to keep encoded strings as short as possible.

  • Compression is done using Deflate algorithm.

  • Code in PHP, Javascript, Python were readily available on various sources. Perl 5 was missing from the list.

  • Read more: PlantUML Text Encoding


The Lingua:: namespace is intended for human languages (think Linguistic), not computer languages. Encode::PlantUML would be a more appropriate module name.
Thank you for your valuable suggestion. This suggestion is accepted.
Yes, pretty please, do *not* put this in Lingua::
For that matter, Encode:: is about encodings more in the character set sense, so that’s not a good place for the module either. I think UML:: makes the most sense actually, i.e. UML::PlantUML::Encoder. There isn’t much in UML:: so far, but there are a handful of modules. It would also be just fine to call this PlantUML::Encoder, though I would prefer that name slightly less.
Thank you for your valuable suggestion. This suggestion is accepted as conclusive. Henceforth, this module is renamed from Lingua::PlantUML::Encode to UML::PlantUML::Encoder

Please sign up to post a review.