- 论坛徽章:
- 5
|
what's the result?- #!/usr/bin/perl -wT
- use strict;
- # Include cgi
- use CGI qw/:standard :html3/;
- use CGI::Carp 'fatalsToBrowser';
- use CGI::Session;
- use XML::Simple;
- #----------------
- #use Encode;
- #my $BASEDIR = "/var/www/tangbuild";
- my $cgi = new CGI;
- my %first;
- my $y = new XML::Simple;
- my $search_word = $cgi->param('search_word');
- # check $search_word ----------------
- print "|$search_word|"; # what's the result?
- # -----------------------------------
- my $xml =
- `/var/www/supose/supose-0.6.2/bin/supose se -I /var/www/supose/repositroy -Q $search_word -x`;
- print "XML\n$xml\n\n";
- my $data = $y->XMLin($xml);
- my @print = qw/author path filename message contents/;
- 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";
- }
- 1;
复制代码 |
|