Windows NT KAMIDAKI 10.0 build 19045 (Windows 10) AMD64
Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.3.9
Server IP : 192.168.3.16 & Your IP : 216.73.216.204
Domains :
Cant Read [ /etc/named.conf ]
User : SISTEMA
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
C: /
xampp /
perl /
bin /
Delete
Unzip
Name
Size
Permission
Date
Action
SOAPsh.bat
3.35
KB
-rwxrwxrwx
2021-01-24 18:08
SOAPsh.pl
2.75
KB
-rw-rw-rw-
2021-01-24 18:01
bdf2gdfont.bat
5.26
KB
-rwxrwxrwx
2021-01-24 18:08
bdf2gdfont.pl
4.75
KB
-rw-rw-rw-
2021-01-24 17:46
chartex
5.67
KB
-rw-rw-rw-
2021-01-24 18:01
chartex.bat
6.47
KB
-rwxrwxrwx
2021-01-24 18:08
config_data
7.2
KB
-rw-rw-rw-
2021-01-24 18:01
config_data.bat
7.73
KB
-rwxrwxrwx
2024-07-26 17:42
corelist.bat
15.75
KB
-rwxrwxrwx
2023-11-19 11:41
cpan
8.06
KB
-rw-rw-rw-
2021-01-24 18:01
cpan-mirrors
4.18
KB
-rw-rw-rw-
2021-01-24 18:01
cpan-mirrors.bat
5.1
KB
-rwxrwxrwx
2021-01-24 18:08
cpan-outdated
8.85
KB
-rw-rw-rw-
2021-01-24 18:01
cpan-outdated.bat
9.67
KB
-rwxrwxrwx
2021-01-24 18:08
cpan.bat
9.16
KB
-rwxrwxrwx
2021-01-24 18:08
cpan2dist
21.22
KB
-rw-rw-rw-
2021-01-24 18:01
cpan2dist.bat
22.39
KB
-rwxrwxrwx
2021-01-24 18:08
cpandb
6.6
KB
-rw-rw-rw-
2021-01-24 18:01
cpandb.bat
7.37
KB
-rwxrwxrwx
2021-01-24 18:08
cpanel_json_xs
9.75
KB
-rw-rw-rw-
2021-01-24 18:01
cpanel_json_xs.bat
10.58
KB
-rwxrwxrwx
2021-01-24 18:08
cpanfile-dump
3.45
KB
-rw-rw-rw-
2021-01-24 16:20
cpanfile-dump.bat
4.08
KB
-rwxrwxrwx
2021-01-24 18:08
cpanm
295.67
KB
-rw-rw-rw-
2021-01-24 16:36
cpanm.bat
297.23
KB
-rwxrwxrwx
2021-01-24 18:08
cpanp
3.22
KB
-rw-rw-rw-
2021-01-24 18:01
cpanp-run-perl
459
B
-rw-rw-rw-
2021-01-24 16:38
cpanp-run-perl.bat
990
B
-rwxrwxrwx
2021-01-24 18:08
cpanp.bat
3.84
KB
-rwxrwxrwx
2021-01-24 18:08
crc32
1.01
KB
-rw-rw-rw-
2021-01-24 18:01
crc32.bat
1.57
KB
-rwxrwxrwx
2021-01-24 18:08
dbicadmin
7
KB
-rw-rw-rw-
2021-01-24 18:01
dbicadmin.bat
7.87
KB
-rwxrwxrwx
2021-01-24 18:08
dbilogstrip
1.39
KB
-rw-rw-rw-
2021-01-24 17:15
dbilogstrip.bat
1.89
KB
-rwxrwxrwx
2021-01-24 18:08
dbiprof
6.31
KB
-rw-rw-rw-
2021-01-24 17:15
dbiprof.bat
6.82
KB
-rwxrwxrwx
2021-01-24 18:08
dbiproxy
5.44
KB
-rw-rw-rw-
2021-01-24 17:15
dbiproxy.bat
5.95
KB
-rwxrwxrwx
2021-01-24 18:08
enc2xs
40.68
KB
-rw-rw-rw-
2021-01-24 18:01
enc2xs.bat
42.87
KB
-rwxrwxrwx
2021-01-24 18:08
encguess
2.91
KB
-rw-rw-rw-
2021-01-24 18:01
encguess.bat
3.8
KB
-rwxrwxrwx
2021-01-24 18:08
exe_update.bat
4.71
KB
-rwxrwxrwx
2021-01-24 18:08
exe_update.pl
4.05
KB
-rw-rw-rw-
2021-01-24 18:01
exetype.bat
3.53
KB
-rwxrwxrwx
2021-01-24 18:08
extract_vba
2.98
KB
-rw-rw-rw-
2021-01-24 18:01
extract_vba.bat
3.62
KB
-rwxrwxrwx
2021-01-24 18:08
factor.bat
3.77
KB
-rwxrwxrwx
2021-01-24 18:08
factor.pl
3.16
KB
-rw-rw-rw-
2021-01-24 18:01
findrule
3.24
KB
-rw-rw-rw-
2021-01-24 16:52
findrule.bat
3.88
KB
-rwxrwxrwx
2021-01-24 18:08
h2ph.bat
30.27
KB
-rwxrwxrwx
2024-07-26 17:42
h2xs.bat
62.43
KB
-rwxrwxrwx
2024-07-26 17:42
htmltree
1.28
KB
-rw-rw-rw-
2021-01-24 18:01
htmltree.bat
1.81
KB
-rwxrwxrwx
2024-07-26 17:42
hypnotoad
1.03
KB
-rw-rw-rw-
2021-01-24 16:59
hypnotoad.bat
1.58
KB
-rwxrwxrwx
2021-01-24 18:08
instmodsh
4.09
KB
-rw-rw-rw-
2021-01-24 18:01
instmodsh.bat
5.03
KB
-rwxrwxrwx
2021-01-24 18:08
json_pp
4.77
KB
-rw-rw-rw-
2021-01-24 18:01
json_pp.bat
5.52
KB
-rwxrwxrwx
2024-07-26 17:42
json_xs
6.84
KB
-rw-rw-rw-
2021-01-24 18:01
json_xs.bat
7.6
KB
-rwxrwxrwx
2021-01-24 18:08
kwalitee-metrics
2.34
KB
-rw-rw-rw-
2021-01-24 18:01
kwalitee-metrics.bat
2.96
KB
-rwxrwxrwx
2021-01-24 18:08
libgcc_s_seh-1.dll
74.5
KB
-rw-rw-rw-
2019-03-14 23:36
libnetcfg.bat
16.88
KB
-rwxrwxrwx
2024-07-26 17:42
libstdc++-6.dll
1.36
MB
-rw-rw-rw-
2019-03-14 23:36
libwinpthread-1.dll
51
KB
-rw-rw-rw-
2019-03-14 23:36
llw32helper.bat
4.8
KB
-rwxrwxrwx
2021-01-24 18:08
llw32helper.pl
4.13
KB
-rw-rw-rw-
2021-01-24 17:51
lwp-download
10.04
KB
-rw-rw-rw-
2021-01-24 18:01
lwp-download.bat
10.88
KB
-rwxrwxrwx
2021-01-24 18:08
lwp-dump
2.64
KB
-rw-rw-rw-
2021-01-24 18:01
lwp-dump.bat
3.26
KB
-rwxrwxrwx
2021-01-24 18:08
lwp-mirror
2.35
KB
-rw-rw-rw-
2021-01-24 18:01
lwp-mirror.bat
2.96
KB
-rwxrwxrwx
2021-01-24 18:08
lwp-request
15.81
KB
-rw-rw-rw-
2021-01-24 18:01
lwp-request.bat
16.88
KB
-rwxrwxrwx
2021-01-24 18:08
mech-dump
4.74
KB
-rw-rw-rw-
2021-01-24 18:01
mech-dump.bat
5.44
KB
-rwxrwxrwx
2021-01-24 18:08
minicpan
5.36
KB
-rw-rw-rw-
2021-01-24 18:08
minicpan.bat
6.05
KB
-rwxrwxrwx
2021-01-24 18:08
module-version
2.06
KB
-rw-rw-rw-
2021-01-24 17:51
module-version.bat
2.65
KB
-rwxrwxrwx
2021-01-24 18:08
mojo
408
B
-rw-rw-rw-
2021-01-24 16:59
mojo.bat
953
B
-rwxrwxrwx
2021-01-24 18:08
moose-outdated
427
B
-rw-rw-rw-
2021-01-24 18:01
moose-outdated.bat
977
B
-rwxrwxrwx
2021-01-24 18:08
morbo
2.15
KB
-rw-rw-rw-
2021-01-24 16:59
morbo.bat
2.72
KB
-rwxrwxrwx
2021-01-24 18:08
mymeta-cpanfile
2.7
KB
-rw-rw-rw-
2021-01-24 16:20
mymeta-cpanfile.bat
3.32
KB
-rwxrwxrwx
2021-01-24 18:08
nssm_32.exe
288
KB
-rwxrwxrwx
2021-01-24 16:50
nssm_64.exe
323.5
KB
-rwxrwxrwx
2021-01-24 16:50
package-stash-conflicts
463
B
-rw-rw-rw-
2021-01-24 18:01
package-stash-conflicts.bat
1013
B
-rwxrwxrwx
2021-01-24 18:08
parinstallppd
3.35
KB
-rw-rw-rw-
2021-01-24 18:01
parinstallppd.bat
3.99
KB
-rwxrwxrwx
2021-01-24 18:08
perl.exe
39
KB
-rwxrwxrwx
2021-01-24 16:06
perl5.32.1.exe
39
KB
-rwxrwxrwx
2021-01-24 16:06
perl532.dll
3.26
MB
-rw-rw-rw-
2021-01-24 16:07
perlbug.bat
46.8
KB
-rwxrwxrwx
2024-07-26 17:42
perldoc.bat
1016
B
-rwxrwxrwx
2023-11-19 11:41
perlglob.bat
1.95
KB
-rwxrwxrwx
2021-01-24 18:08
perlglob.exe
17
KB
-rwxrwxrwx
2021-01-24 16:01
perlivp.bat
11.72
KB
-rwxrwxrwx
2024-07-26 17:42
perlthanks.bat
46.8
KB
-rwxrwxrwx
2024-07-26 17:42
perltidy
175.27
KB
-rw-rw-rw-
2021-01-24 18:01
perltidy.bat
180.32
KB
-rwxrwxrwx
2021-01-24 18:08
pgplet
10.37
KB
-rw-rw-rw-
2021-01-24 18:01
pgplet.bat
11.22
KB
-rwxrwxrwx
2021-01-24 18:08
piconv
8.07
KB
-rw-rw-rw-
2021-01-24 18:01
piconv.bat
9.13
KB
-rwxrwxrwx
2021-01-24 18:08
pkg-config
46.94
KB
-rw-rw-rw-
2021-01-24 18:01
pkg-config.bat
49.2
KB
-rwxrwxrwx
2021-01-24 18:08
pl2bat.bat
11.49
KB
-rwxrwxrwx
2021-01-24 18:08
pl2bat.pl
10.4
KB
-rw-rw-rw-
2021-01-24 18:01
pl2pm.bat
5.56
KB
-rwxrwxrwx
2024-07-26 17:42
pler
540
B
-rw-rw-rw-
2021-01-24 18:01
pler.bat
1.07
KB
-rwxrwxrwx
2021-01-24 18:08
pm-uninstall
820
B
-rw-rw-rw-
2021-01-24 18:01
pm-uninstall.bat
1.28
KB
-rwxrwxrwx
2023-11-19 11:41
pod2html.bat
5.02
KB
-rwxrwxrwx
2024-07-26 17:42
pod2latex
10.39
KB
-rw-rw-rw-
2024-07-26 17:42
pod2latex.bat
10.92
KB
-rwxrwxrwx
2024-07-26 17:42
pod2man.bat
15.42
KB
-rwxrwxrwx
2023-11-19 11:41
pod2text.bat
11.29
KB
-rwxrwxrwx
2023-11-19 11:41
pod2usage
4.16
KB
-rw-rw-rw-
2021-01-24 16:27
pod2usage.bat
4.67
KB
-rwxrwxrwx
2021-01-24 18:08
pod_cover
1.37
KB
-rw-rw-rw-
2021-01-24 18:01
pod_cover.bat
1.94
KB
-rwxrwxrwx
2021-01-24 18:08
podchecker
3.7
KB
-rw-rw-rw-
2021-01-24 16:27
podchecker.bat
4.21
KB
-rwxrwxrwx
2021-01-24 18:08
podselect
2.56
KB
-rw-rw-rw-
2021-01-24 16:25
podselect.bat
3.07
KB
-rwxrwxrwx
2021-01-24 18:08
ppd2par
4.64
KB
-rw-rw-rw-
2021-01-24 18:01
ppd2par.bat
5.32
KB
-rwxrwxrwx
2021-01-24 18:08
ppm.bat
35.53
KB
-rwxrwxrwx
2021-01-24 18:08
ppm.pl
33.99
KB
-rw-rw-rw-
2021-01-24 18:01
primes.bat
21.45
KB
-rwxrwxrwx
2021-01-24 18:08
primes.pl
20.34
KB
-rw-rw-rw-
2021-01-24 18:01
prove.bat
14.07
KB
-rwxrwxrwx
2023-11-19 11:41
ptar
3.38
KB
-rw-rw-rw-
2021-01-24 18:01
ptar.bat
4.28
KB
-rwxrwxrwx
2021-01-24 18:08
ptardiff
2.48
KB
-rw-rw-rw-
2021-01-24 18:01
ptardiff.bat
3.35
KB
-rwxrwxrwx
2021-01-24 18:08
ptargrep
4.19
KB
-rw-rw-rw-
2021-01-24 18:01
ptargrep.bat
5.14
KB
-rwxrwxrwx
2021-01-24 18:08
runperl.bat
2.72
KB
-rwxrwxrwx
2021-01-24 18:08
scan-perl-prereqs-nqlite
5.28
KB
-rw-rw-rw-
2021-01-24 16:24
scan-perl-prereqs-nqlite.bat
6
KB
-rwxrwxrwx
2021-01-24 18:08
search.bat
55.83
KB
-rwxrwxrwx
2021-01-24 18:08
shasum.bat
10.48
KB
-rwxrwxrwx
2023-11-19 11:41
splain.bat
20.43
KB
-rwxrwxrwx
2024-07-26 17:42
streamzip
5.45
KB
-rw-rw-rw-
2021-01-24 18:01
streamzip.bat
6.17
KB
-rwxrwxrwx
2021-01-24 18:08
stubmaker.bat
4.01
KB
-rwxrwxrwx
2021-01-24 18:08
stubmaker.pl
3.35
KB
-rw-rw-rw-
2021-01-24 18:01
test-yaml
1017
B
-rw-rw-rw-
2021-01-24 18:01
test-yaml.bat
1.56
KB
-rwxrwxrwx
2021-01-24 18:08
tpage
8.85
KB
-rw-rw-rw-
2021-01-24 18:01
tpage.bat
9.64
KB
-rwxrwxrwx
2021-01-24 18:08
ttree
38.21
KB
-rw-rw-rw-
2021-01-24 18:01
ttree.bat
39.9
KB
-rwxrwxrwx
2021-01-24 18:08
use-devel-checklib
2.7
KB
-rw-rw-rw-
2021-01-24 16:53
use-devel-checklib.bat
3.31
KB
-rwxrwxrwx
2021-01-24 18:08
whirlpoolsum
4.93
KB
-rw-rw-rw-
2021-01-24 18:01
whirlpoolsum.bat
5.67
KB
-rwxrwxrwx
2021-01-24 18:08
wperl.exe
39
KB
-rwxrwxrwx
2021-01-24 16:06
xml_grep
13.32
KB
-rw-rw-rw-
2021-01-24 18:01
xml_grep.bat
14.3
KB
-rwxrwxrwx
2021-01-24 18:08
xml_merge
3.89
KB
-rw-rw-rw-
2021-01-24 18:01
xml_merge.bat
4.55
KB
-rwxrwxrwx
2021-01-24 18:08
xml_pp
7.82
KB
-rw-rw-rw-
2021-01-24 18:01
xml_pp.bat
8.61
KB
-rwxrwxrwx
2021-01-24 18:08
xml_spellcheck
6.34
KB
-rw-rw-rw-
2021-01-24 18:01
xml_spellcheck.bat
7.1
KB
-rwxrwxrwx
2021-01-24 18:08
xml_split
21.13
KB
-rw-rw-rw-
2021-01-24 18:01
xml_split.bat
22.27
KB
-rwxrwxrwx
2021-01-24 18:08
xsubpp.bat
5.78
KB
-rwxrwxrwx
2023-11-19 11:41
zipdetails
56.01
KB
-rw-rw-rw-
2021-01-24 18:01
zipdetails.bat
58.95
KB
-rwxrwxrwx
2021-01-24 18:08
Save
Rename
#!perl -w use strict; use Getopt::Long; use Pod::Usage; use XML::Twig; my $VERSION="0.9"; # options (all used globally in the script) my( $help, $man, @roots, @paths, $files, $count, $nb_results, $nb_results_per_file, $encoding, @exclude, $wrap, $nowrap, $descr, $group, $pretty_print, $version, $text_only, $date, $html, $tidy, $add_ns, $verbose, $strict ); # used to check if the wrapping tags need to be output my $results = 0; my $file_results = 0; # first process the case where the user provides only # an xpath expression and a list of files if( @ARGV && ($ARGV[0] !~ m{^-}) ) { splice( @ARGV, 0, 0, '--group_by_file', 'file', '--pretty_print', 'indented', '--cond'); } GetOptions( 'help' => \$help, 'man' => \$man, 'Version' => \$version, 'cond=s' => \@paths, 'exclude|v=s' => \@exclude, 'root=s' => \@roots, 'files' => \$files, 'count' => \$count, 'nb_results=i' => \$nb_results, 'by_file=i' => \$nb_results_per_file, 'encoding=s' => \$encoding, 'wrap:s' => \$wrap, 'nowrap' => \$nowrap, 'descr:s' => \$descr, 'group_by_file:s' => \$group, 'pretty_print:s' => \$pretty_print, 'text_only' => \$text_only, 'date!' => \$date, 'strict' => \$strict, 'html' => \$html, 'tidy' => \$tidy, 'add_ns' => \$add_ns, 'verbose' => \$verbose, ) or pod2usage(2); pod2usage(1) if $help; pod2usage(-exitstatus => 0, -verbose => 2) if $man; if( $version) { warn "$0 version $VERSION\n"; exit; } binmode STDOUT, ':utf8'; # case where options are given, but no root or path, assume the # first arg is a path if( !@roots and !@paths and !@exclude and @ARGV) { @paths= shift @ARGV; } unless( @roots or @paths or @exclude or $files) { pod2usage(1); exit; } if( ($files or $count) and !@paths) { pod2usage(1); exit; } if( ($files or $count) and (@roots or $encoding or defined( $wrap) or defined( $group) or defined( $pretty_print))) { pod2usage(1); exit; } if( $files and !@ARGV) { pod2usage(1); exit; } if( !$files and !$count and @paths and !@roots) { @roots= @paths; @paths=(); } $date=1 unless( defined $date); # defaults for optional arguments to options $group = 'file' if( defined $group and !$group); $pretty_print = 'indented' if( defined $pretty_print and !$pretty_print); if( $nowrap) { $wrap=''; } elsif( !defined( $wrap) and (@roots or @paths)) { $wrap= 'xml_grep'; } if( !defined( $descr) and (@roots or @paths)) { if( $date) { $date= localtime(); $descr = qq{version="$VERSION" date="$date"} } else { $descr = qq{version="$VERSION"}; } } # some globals my $current_file; my $count_file = 0; my $count_total = 0; my $nb_results_left_in_current_file=0; # will be used to create the twig my %options; if( $count) { my $twig_roots={}; my $twig_root= sub { $count_file++; $_[0]->purge; }; foreach my $path (@paths) { $twig_roots->{$path}= $twig_root; } $options{twig_roots}= $twig_roots; } elsif( @exclude) { # general options $nowrap=1; # twig options $options{twig_print_outside_roots} = 1; my $root_handlers={}; foreach my $exclude (@exclude) { $root_handlers->{$exclude}= sub { }; } $options{twig_roots}= $root_handlers; } else { create_regular_handlers( \%options, \@roots, \@paths); } if( $tidy) { $html= 1; $options{use_tidy}= 1; } $options{pretty_print} = $pretty_print if( $pretty_print); $options{output_encoding} = $encoding if( $encoding); my $t= create_twig( %options); if( @ARGV) { foreach my $file (@ARGV) { $current_file= $file; if( $nb_results_per_file) { $nb_results_left_in_current_file= $nb_results_per_file; } if( $verbose) { warn "parsing '$file'\n"; } my $ok= $html && ($current_file=~ m{^(http|ftp|file)://}) ? $t->safe_parseurl_html( $file) : ($current_file=~ m{^(http|ftp|file)://}) ? $t->safe_parseurl( $file) : $html ? $t->safe_parsefile_html( $file) : $t->safe_parsefile( $file); if( !$ok) { if( $@ =~ m{XMLGREP: FOUND}) { # in files mode print $current_file, "\n"; $nb_results--; exit unless( $nb_results); } elsif( $@ =~ m{^XMLGREP: NB_RESULT_REACHED}) { print file_result_end() if( $group && $file_results); print result_end() if( $results); exit; } else { $@ ||= 'unknown cause'; if( $strict) { die $@; } warn $@; if( !$count) { print "<!-- error parsing file '$file' -->\n"; } } } if( $count) { print "$current_file: $count_file\n"; $count_total += $count_file; $count_file=0; } elsif( @roots) { print file_result_end() if( $file_results); } elsif( $count) { print "$count_total matches\n"; } } if( $count) { print "total: $count_total\n"; } print result_end() if( $results); } else { $file_results=0; my $ok= $t->safe_parse( \*STDIN); if( !$ok and ( $@ !~ m{^XMLGREP: NB_RESULT_REACHED})) { if( !$strict) { warn $@; } else { die $@; } } if( $count) { print "$count_total matches\n"; } else { print result_end(); } } sub create_regular_handlers { my( $options, $roots, $paths)= @_; if( @$roots) { my $root_handlers={}; my $root_handler= twig_roots_handler( @$paths); foreach my $root (@$roots) { $root_handlers->{$root}= $root_handler; } $options->{twig_roots}= $root_handlers; } if( @$paths) { my $twig_handlers={}; my $twig_handler= twig_handlers(); foreach my $path (@$paths) { $twig_handlers->{$path}= $twig_handler; } $options->{twig_handlers}= $twig_handlers; } } sub create_twig { my( %options)= @_; my $twig; eval { $twig= XML::Twig->new( %options) }; if( $@) { # see if we are in the case where the only condition uses string() or regexp if( ($@=~ m{^(regexp|string\(\)) condition not supported on twig_roots option}) && $options{twig_roots} && !$options{twig_handlers} && ( keys %{$options{twig_roots}} == 1) ) { # in this case add the proper twig_roots option my $cond= (keys %{$options{twig_roots}})[0]; (my $root= $cond)=~ s{\[[^\]]*\]$}{}; #warn "cond: '$cond' - root: '$root'\n"; delete $options{twig_roots}; delete $options{twig_handlers}; @paths= ($cond); @roots= ($root); create_regular_handlers( \%options, \@roots, \@paths); return create_twig( %options); } elsif( $@=~ m{^wrong condition: unrecognized expression in handler: '(.*?)'}) { die "error in filter condition '$1'\n"; } else { die "error: $@"; } } return $twig; } sub twig_roots_handler { my( @paths)= @_; return sub { my( $t, $root)= @_; if( !@paths or $_->att( '#print')) { print result_start() if( !$results); print file_result_start() if( $group && !$file_results); if( $text_only) { print $root->text, "\n"; } else { $root->print; } if( ! -- $nb_results) { $@= "XMLGREP: NB_RESULT_REACHED"; die; } if( ! -- $nb_results_left_in_current_file) { $t->finish_now(); } } $t->purge; 1; }; } sub twig_handlers { if( $files) { return sub { $@="XMLGREP: FOUND"; die; }; } else { return sub { my( $t, $hit)= @_; foreach my $elt ( $hit->ancestors_or_self) { $elt->set_att( '#print' => 1); } 1; }; } } sub result_start { $results=1; return if( $text_only); my $enc_decl= $encoding ? qq{encoding="$encoding" } : ''; return $wrap ? qq{<?xml version="1.0" $enc_decl?>\n<$wrap $descr>\n} : ''; } sub result_end { my $result; return if( $text_only); if( !$group) { $result= "\n"; } $result .= qq{</$wrap>\n} if( $wrap); return $result; } sub file_result_start { $file_results=1; return if( $text_only); my $result; $result= qq{<$group filename="$current_file">}; if( !$pretty_print) { $result.= "\n"; } return $result; } sub file_result_end { $file_results=0; return '' if( $text_only); return qq{\n</$group>\n}; } __END__ =head1 NAME xml_grep - grep XML files looking for specific elements =head1 SYNOPSYS xml_grep [options] <file list> or xml_grep <xpath expression> <file list> By default you can just give C<xml_grep> an XPath expression and a list of files, and get an XML file with the result. This is equivalent to writing xml_grep --group_by_file file --pretty_print indented --cond <file list> =head1 OPTIONS =over 4 =item B<--help> brief help message =item B<--man> full documentation =item B<--Version> display the tool version =item B<--root> <cond> look for and return xml chunks matching <cond> if neither C<--root> nor C<--file> are used then the element(s) that trigger the C<--cond> option is (are) used. If C<--cond> is not used then all elements matching the <cond> are returned several C<--root> can be provided =item B<--cond> <cond> return the chunks (or file names) only if they contain elements matching <cond> several C<--cond> can be provided (in which case they are OR'ed) =item B<--files> return only file names (do not generate an XML output) usage of this option precludes using any of the options that define the XML output: C<--roots>, C<--encoding>, C<--wrap>, C<--group_by_file> or C<--pretty_print> =item B<--count> return only the number of matches in each file usage of this option precludes using any of the options that define the XML output: C<--roots>, C<--encoding>, C<--wrap>, C<--group_by_file> or C<--pretty_print> =item B<--strict> without this option parsing errors are reported to STDOUT and the file skipped =item B<--date> when on (by default) the wrapping element get a C<date> attribute that gives the date the tool was run. with C<--nodate> this attribute is not added, which can be useful if you need to compare 2 runs. =item B<--encoding> <enc> encoding of the xml output (utf-8 by default) =item B<--nb_results> <nb> output only <nb> results =item B<--by_file> output only <nb> results by file =item B<--wrap> <tag> wrap the xml result in the provided tag (defaults to 'xml_grep') If wrap is set to an empty string (C<--wrap ''>) then the xml result is not wrapped at all. =item B<--nowrap> same as using C<--wrap ''>: the xml result is not wrapped. =item B<--descr> <string> attributes of the wrap tag (defaults to C<< version="<VERSION>" date="<date>" >>) =item B<--group_by_file> <optional_tag> wrap results for each files into a separate element. By default that element is named C<file>. It has an attribute named C<filename> that gives the name of the file. the short version of this option is B<-g> =item B<--exclude> <condition> same as using C<-v> in grep: the elements that match the condition are excluded from the result, the input file(s) is (are) otherwise unchanged the short form of this option is B<-v> =item B<--pretty_print> <optional_style> pretty print the output using XML::Twig styles ('C<indented>', 'C<record>' or 'C<record_c>' are probably what you are looking for) if the option is used but no style is given then 'C<indented>' is used short form for this argument is B<-s> =item B<--text_only> Displays the text of the results, one by line. =item B<--html> Allow HTML input, files are converted using HTML::TreeBuilder =item B<--Tidy> Allow HTML input, files are converted using HTML::Tidy =back =head2 Condition Syntax <cond> is an XPath-like expression as allowed by XML::Twig to trigger handlers. examples: 'para' 'para[@compact="compact"]' '*[@urgent]' '*[@urgent="1"]' 'para[string()="WARNING"]' see XML::Twig for a more complete description of the <cond> syntax options are processed by Getopt::Long so they can start with '-' or '--' and can be abbreviated (C<-r> instead of C<--root> for example) =head1 DESCRIPTION B<xml_grep> does a grep on XML files. Instead of using regular expressions it uses XPath expressions (in fact the subset of XPath supported by XML::Twig) the results can be the names of the files or XML elements containing matching elements. =head1 SEE ALSO XML::Twig Getopt::Long =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR Michel Rodriguez <mirod@xmltwig.com>