You need only four simple steps:
You can click the default unformatted code above to view the effect.
A Perl formatter tool can beautify your compact Perl code, making your Perl code more readable.
It also makes it easier for developers to read code written by other developers.
Code before formatting
sub example_function {
my ($arg1,$arg2)=@_;
my $result=$arg1+$arg2;
print "The result is $result\n";
}
Code after formatting
sub example_function {
my ( $arg1, $arg2 ) = @_;
my $result = $arg1 + $arg2;
print "The result is $result\n";
}