Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 8b3891ad59d78d6385e33885b232e630 > files > 12

perltidy-20181120.0.0-1.mga7.noarch.rpm

#!/usr/bin/perl -wn

# This program was posted on the MacPerl mailing list by 
# Charles Albrecht as one way to get perltidy to work as a filter
# under BBEdit.

use Perl::Tidy;

BEGIN { my $input_string = ""; my $output_string = ""; }

$input_string .= $_;

END {
    my $err=Perl::Tidy::perltidy(
        source      => \$input_string,
        destination => \$output_string
    );
    if ($err){
        die "Error calling perltidy\n";
    }
    print "$output_string\n";
}

__END__