NAME

Beautifier - Perl extension for beautifying/styling/prettyprinting perl code.

SYNOPSIS

  use Beautifier;

  my $beautifier = new Beautifier;
  print $beautifier->Beautify(
                        {'indent' => "  "},
                        "$this = 'some perl code';\n";
                      );

DESCRIPTION

This module pretty prints/beautifies perl code. It does 3 things: - Indenting - Spacing around () and = and so forth - Curly placing

This might come in handy when working on other people's code (don't you hate that?) It uses my coding conventions, like placing the curly on the next line. Feel free to change it to your style (which, if different from mine, is wrong ;) Here is what code will look like after it's been crunched by Beautifier:

  if (($varName =~ m//) && (-f $fileName))
  {
    print "Hello, world!\n";
  }

WARNING: A working program might no longer work after Beautifier did her thing on it. (Beautifier is definitely female)

EXAMPLES

  #!/usr/bin/perl -w

  use strict;
  use Beautifier;


  undef $/; ### To read file all in one swoop
  open (FH, "test.pl") || die $!;
  my $fileContent = <FH>;
  close (FH);
  $/ = "\n"; ### Back to default

  my $beautify = new Beautifier;
  print $beautify->Beautify(
                            { 'indent' => "  ",
                            },
                            $fileContent
                           );

AUTHOR

Teun van Eijsden, <teun@chello.nl>

SEE ALSO

perl.