AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.145.7.194
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/perltidy-20121207/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /usr/share/doc/perltidy-20121207/examples/ex_mp.pl
#!/usr/bin/perl -w

# example call to perltidy from man page documentation of Perl::Tidy

use strict;
use Perl::Tidy;

my $source_string = <<'EOT';
my$error=Perl::Tidy::perltidy(argv=>$argv,source=>\$source_string,
    destination=>\$dest_string,stderr=>\$stderr_string,
errorfile=>\$errorfile_string,);
EOT

my $dest_string;
my $stderr_string;
my $errorfile_string;
my $argv = "-npro";   # Ignore any .perltidyrc at this site
$argv .= " -pbp";     # Format according to perl best practices
$argv .= " -nst";     # Must turn off -st in case -pbp is specified
$argv .= " -se";      # -se appends the errorfile to stderr
## $argv .= " --spell-check";  # uncomment to trigger an error

print "<<RAW SOURCE>>\n$source_string\n";

my $error = Perl::Tidy::perltidy(
    argv        => $argv,
    source      => \$source_string,
    destination => \$dest_string,
    stderr      => \$stderr_string,
    errorfile   => \$errorfile_string,    # not used when -se flag is set
    ##phasers     => 'stun',                # uncomment to trigger an error
);

if ($error) {

    # serious error in input parameters, no tidied output
    print "<<STDERR>>\n$stderr_string\n";
    die "Exiting because of serious errors\n";
}

if ($dest_string)      { print "<<TIDIED SOURCE>>\n$dest_string\n" }
if ($stderr_string)    { print "<<STDERR>>\n$stderr_string\n" }
if ($errorfile_string) { print "<<.ERR file>>\n$errorfile_string\n" }

Anon7 - 2022
AnonSec Team