Michal Josef Špaček

NAME

PYX::Sort - Processing PYX data or file and sort element attributes.

SYNOPSIS

 use PYX::Sort;
 my $obj = PYX::Sort->new(%parameters);
 $obj->parse($pyx, $out);
 $obj->parse_file($input_file, $out);
 $obj->parse_handle($input_file_handler, $out);

METHODS

new(%parameters)
 Constructor.
  • output_handler

     Output handler.
     Default value is \*STDOUT.
parse($pyx[, $out])
 Parse PYX text or array of PYX text and print sorted list of element attributes in PYX format.
 If $out not present, use 'output_handler'.
 Returns undef.
parse_file($input_file[, $out])
 Parse file with PYX data and print sorted list of element attributes in PYX format.
 If $out not present, use 'output_handler'.
 Returns undef.
parse_handler($input_file[, $out])
 Parse PYX handler print sorted list of element attributes in PYX format.
 If $out not present, use 'output_handler'.
 Returns undef.

ERRORS

 new():
         From Class::Utils::set_params():
                 Unknown parameter '%s'.

EXAMPLE

 # Pragmas.
 use strict;
 use warnings;

 # Modules.
 use PYX::Sort;

 # Example data.
 my $pyx = <<'END';
 (tag
 Aattr1 value
 Aattr2 value
 Aattr3 value
 -text
 )tag
 END

 # PYX::Sort object.
 my $obj = PYX::Sort->new;

 # Parse.
 $obj->parse($pyx);

 # Output:
 # (tag
 # Aattr1="value"
 # Aattr2="value"
 # Aattr3="value"
 # -text
 # )tag

DEPENDENCIES

Class::Utils, PYX::Parser.

SEE ALSO

Task::PYX

Install the PYX modules.

REPOSITORY

https://github.com/tupinek/PYX-Sort

AUTHOR

Michal Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

 © 2011-2015 Michal Špaček
 BSD 2-Clause License

VERSION

0.03