Perl Viewer, Formatter, Editor

Related Tools

Options:

HTML <style>, <script> formatting:

Enter your messy, minified, or obfuscated Perl into the field above to have it cleaned up and made pretty. The editor above also contains helpful line numbers and syntax highlighting. There are many option to tailor the beautifier to your personal formatting tastes.

When do you use Perl Viewer, Formatter, Editor

Often when writing Perl your indentation, spacing, and other formatting can become a bit disorganized. It is also common for multiple developers to work on a single project who have different formatting techniques.  This tool is helpful for making the formatting of a file consistent. It is also common for Perl to be minified or obfuscated. You can use this tool to make that code look pretty and readable so it is easier to edit.

Examples

The minified Perl below:

if (1==1) {
$one = $ENV{'QUERY_STRING'}; print ('test');
} elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
}

Becomes this beautified Perl:

if (1 == 1) {
    $one = $ENV {
        'QUERY_STRING'
    };
    print('test');
}
elsif($ENV {
        'REQUEST_METHOD'
    }
    eq 'POST') {
    read(STDIN, $in, $ENV {
        'CONTENT_LENGTH'
    });
}