Compress::BraceExpansion

Compress::BraceExpansion is a Perl module to create a human-readable compressed string suitable for shell brace expansion.
Download

Compress::BraceExpansion Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Alex White
  • Publisher web site:
  • http://search.cpan.org/~vvu/Compress-BraceExpansion-v0.1.3/lib/Compress/BraceExpansion.pm

Compress::BraceExpansion Tags


Compress::BraceExpansion Description

Compress::BraceExpansion is a Perl module to create a human-readable compressed string suitable for shell brace expansion. Compress::BraceExpansion is a Perl module to create a human-readable compressed string suitable for shell brace expansion.SYNOPSIS use Compress::BraceExpansion; # output: ab{c,d} print Compress::BraceExpansion->new( qw( abc abd ) )->shrink(); # output: aabb{cc,dd} print Compress::BraceExpansion->new( qw( aabbcc aabbdd ) )->shrink(); # output: aa{bb{cc,dd},eeff} print Compress::BraceExpansion->new( qw( aabbcc aabbdd aaeeff ) )->shrink();Shells such as bash and zsh have a feature call brace expansion. These allow users to specify an expression to generate a series of strings that contain similar patterns. For example: $ echo a{b,c} ab ac $ echo aa{bb,xx}cc aabbcc aaxxcc $ echo a{b,x}c{d,y}e abcde abcye axcde axcye $ echo a{b,x{y,z}}c abc axyc axzcThis module was designed to take a list of strings with similar patterns (e.g. the output of a shell expansion) and generate the un-expanded expression. Given a reasonably sized array of similar strings, this module will generate a single compressed string that can be comfortably parsed by a human.The current algorithm is most efficient if groups of the input strings start with or end with similar characters. See BUGS AND LIMITATIONS section for more details. Requirements: · Perl


Compress::BraceExpansion Related Software