Data::Formatter::Text

Perl extension for formatting data stored in scalars, hashes, and arrays into strings
Download

Data::Formatter::Text Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Zachary Blair
  • Publisher web site:
  • http://search.cpan.org/~zblair/

Data::Formatter::Text Tags


Data::Formatter::Text Description

Perl extension for formatting data stored in scalars, hashes, and arrays into strings Data::Formatter::Text is a Perl extension for formatting data stored in scalars, hashes, and arrays into strings, definition lists, and bulletted lists, etc. using plain ASCII text.SYNOPSIS use Data::Formatter::Text; # The only argument to the constructor is a file handle. # If no file handle is specified, output is sent to STDOUT my $text = new Data::Formatter::Text(*STDOUT); $text->out('The following foods are tasty:', ); # Outputs, # # The following foods are tasty: # * Pizza # * Pumpkin pie # * Sweet-n-sour Pork # $text->out('Do these things to eat an orange:', ); # Outputs, # # Do these things to eat an orange: # 1. Peal it # 2. Split it # 3. Eat it # # If you don't need to output to a file, you can also use the format() class method # instead of the out() instance method. my $nums = Data::Formatter::Text->format( 'Phone numbers' => { Pat => '123-4567', Joe => '999-9999', Xenu => '000-0000', }); # Stores in $nums: # # Phone numbers # Joe: 999-9999 # Pat: 123-4567 # Xenu: 000-0000 #A module that converts Perl data structures into formatted text, much like Data::Dumper, except for that it formats the data nicely for presentation to a human. For instance, refs to arrays are converted into bulleted lists, refs to arrays that contain only refs to arrays are converted into tables, and refs to hashes are converted to definition lists. Requirements: · Perl


Data::Formatter::Text Related Software