Welcome to perltidy!
    Perltidy is a tool to indent and reformat perl scripts.

    Perltidy is GNU software -- see the included file "LICENSE" for details.

    There are two source distribution files, a .tgz "tarball" for unix
    systems and a zip file, .zip for Windows. The only differences is that
    the line endings have been changed to <cr><lf> for the Windows version.

  Bug Notice

    Prior to release 20010328, there was a bug which perltidy accidentally
    promoted a function name following a print or printf to a filehandle.
    For example,

      print usage() and exit;

    became

      print usage () and exit;

    The result is that perl then considers 'usage' to be a filehandle.
    Unfortunately, instances of this bug usually passed the syntax check
    undetected. To find any such occurance in your script, please rerun with
    the current or future version of perltidy. It will note any bare word
    with any lower case letters, followed by an opening paren, and issue a
    warning that the extra space may need to be removed by hand. My
    appologies if this happened to any of your scripts.

  Installation - Unix

    Try this quick test. Look at lextest.pl with your editor - it's a mess.

    Now issue the command

     perl ./perltidy lextest.pl

    and then look at the output file, which will be lextest.pl.tdy. You
    should see a nicely formatted version of the program, in which perltidy
    has added indentation, whitespace, and line breaks. This simple example
    illustrates what perltidy does.

    Perltidy does not require any special modules. We just have to get the
    script in your path and, optionally, install a man page.

    1. If the script is not executable, use

     chmod +x perltidy

    2. Verify that the initial line in perltidy works for your system by
    entering:

     ./perltidy -h

    which should produce the usage text and then exit. This should usually
    work, but if it does not, you will need to change the first line in
    perltidy to reflect the location of perl on your system. On a Unix
    system, you might find the path to perl with the command 'which perl'.

    3. EDIT Makefile to have the correct paths. See the comments in the
    Makefile.

    You will need to become root unless you change the paths to point to
    somewhere in your home directory. Then issue the command

     make install

    This installs perltidy and the man page perltidy.1.

    5. Test the installation using

     perltidy -h

    You should see the usage screen. Then try

     man perltidy

    which should bring up the manual page if you installed it.

    If you ever want to remove perltidy, you can remove perltidy and its man
    page by hand or use

     make uninstall

  Installation - Windows

    After unpacking the zip file, test the script:

     perl perltidy lextest.pl

    This will produce an output file lextest.pl.tdy which can be compared to
    the input file.

    Placing perltidy and perltidy.bat in your path should work. (You can
    determine your path by issuing the msdos command `PATH'). However, the
    batch file probably will not support file redirection. So, for example,
    to pipe the long help message through 'more', you might have to invoke
    perltidy with perl directly, like this:

     perl \somepath\perltidy -h | more

  Windows problem with command.com

    There is a minor problem that you should be aware of if you are running
    perltidy (and perl) under Windows with the standard command.com shell.
    The problem is that command.com always sends the standard output to the
    screen. This makes it impossible for perltidy to capture the message
    'syntax OK' when it runs 'perl -c' with the following code:

            my $perl_output = <<`END`;
                    perl -c $filename 2>&1
            END

    It also creates an empty file named &1. This means that you will have to
    check for syntax errors yourself. If you do not want to create the empty
    file &1, you can turn off syntax checking with the flag -nsyn. You can
    check the syntax of a file manually by issuing the command

     perl -c filename

    The best way to solve this problem is to use a better shell, such as
    bash - see http://www.cygwin.com

  VMS Notes

    Perltidy runs under VMS. You will probably want to use the .zip
    distribution file to get the <cr><lf> line endings. File extensions will
    use an underscore character instead of a dot, so

          perltidy myfile.pl

    will generate the output file myfile.pl_tdy instead of myfile.pl.tdy,
    and so on.

    If your script starts with a non-perl invocation, eg the following,

     $ perl                               !This is DCL not perl
     $ deck/dollar="$$Not-In-Perl$$"      !This is DCL not perl
     #!/usr/bin/perl

    you must use the -x flag to tell perltidy to wait until the "hash bang"
    line to start parsing, like this:

          perltidy -x myfile.pl

    Information on running perl under VMS can be found at:

     http://w4.lns.cornell.edu/~pvhp/perl/VMS.html

WHAT NEXT
    The documentation has been supplied in three formats: as the man page,
    as an html file, and as a text file. These were produced from
    perltidy.pod and perl2web.pod.

    Reading the brief tutorial should help you use perltidy effectively.

    These documents can also be found at http://perltidy.sourceforge.net

    Perltidy is still being developed, so please check sourceforge
    occasionally for updates if you find that it is useful. New releases are
    announced on freshmeat.net.

FEEDBACK / BUG REPORTS
    If you see ways to improve this document for the particular system on
    which you install perltidy, please let the author know so that it can be
    updated.

    Comments and suggestions are welcome. If you feel that you have
    encountered a bug, please send an email with a brief description of the
    problem to:

     Steve Hancock
     perltidy at users.sourceforge.net
     http://perltidy.sourceforge.net

    Attach the smallest piece of code which demonstrates the bug, plus a
    .LOG file from a perltidy run, if appropriate. Your efforts are greatly
    appreciated.

    Thank You

