- 论坛徽章:
- 5
|
test 看看
perl test.pl
test.pl:- #!/usr/bin/perl -w
- # FOR TEST
- use strict;
- use XML::Simple;
- my %first;
- my $XML = new XML::Simple;
- my $search_word = 'xyz'; # change xyz to yor search_word
- my $xml =
- `/var/www/supose/supose-0.6.2/bin/supose se -I /var/www/supose/repositroy -Q $search_word -x`;
- my $data = $XML->XMLin($xml);
- my @print = qw/author path filename message contents/; # edit this line
- my @data =
- grep { !$first{ $_->{path} . $_->{filename} }++ } @{ $data->{entry} };
- for my $h (@data) {
- print "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< \n";
- printf "%-20s%s\n", $_, $h->{$_} for @print;
- print "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< \n";
- print "\n\n";
- }
复制代码 |
|