9. Example VI: tidy


How to tidy source code?
Install via cpan perltidy and run perltidy file.pl. This will produce the outputfile file.pl.tdy. Example:

Input:


if ($change_all == 0) 
{
$change_all = 1;
} 
elsif 
($change_all == 1)
{
$change_all = 0;
}
Output (with default settings):

if ( $change_all == 0 ) {
    $change_all = 1;
}
elsif ( $change_all == 1 ) {
    $change_all = 0;
}