how can turn my results into hash from array into this

FT = { 'team' => 'score', 'team' => 'score', 'team' => 'score' };
PSTP = { 'team' => 'team', 'team' => 'team', 'team' => 'team' };
#!/usr/bin/perl use strict; use warnings; use Mojo::UserAgent; use Mojo::Util qw(dumper trim); use CGI; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); print "Content-type: text/html\n\n"; my $cgi = CGI->new; my $url = 'https://int.soccerway.com/matches/2020/12/28/'; my $ua = Mojo::UserAgent->new; my @results = $ua ->get( $url ) ->result ->dom ->find( 'table.matches_new tr.match' ) ->map( sub { my $row = $_; my @results = map { trim( $row->at( $_ )->all_text ) } qw( td.minute td.team-a td.score-time td.team-b ); return \@results; } ) ->to_array; print dumper( @results );

Original content, restored by gods:

the code is running and working but i want to archive this:

i want to find a team and its scores after word FT left and right side teams

the problem i have even my little Try am still getting error: cant find team even if the team is on list

#!/usr/bin/perl use strict; use warnings; use CGI; use HTML::TableExtract; use LWP::UserAgent; my $cgi = CGI->new; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => "https://int.soccerway.com/matches +/2020/12/28/"); my $res = $ua->request($req); my $html = $res->decoded_content; $html =~ s/<span.*?<\/span>//gs; $html =~ s/<script.*?<\/script>//gs; $html =~ s/<td(?=[^>]*class="events-button button first-occur")[^>]*>/ +/gs; my $table = HTML::TableExtract->new(); $table->parse($html); my $input = $cgi->param("team"); my $response =''; print "Content-type: text/html\n\n"; foreach my $row ($table->rows) { my $output = join("", @$row); $output =~ s/\R//g; print $output; if ($input) { # Find matching team (Its a must to find team after word FT) if ($output =~ m/$input/) { # After that team the next is score (Gets team scores - left sid +e) # Or after scores what team is near (Gets team scores - Right si +de) my $score = $output =~ /$input\s*?(\S+)/; $response ="Found Team And Score is: $score"; } else { $response ="Can't find team"; } } } print <<EOF; <!DOCTYPE html> <html> <body> <h1>Test</h1> <form method="post"> <label for="team">Enter Team:</label> <input type="text" name="team"><br><br> <input type="submit" value="Check"> </form> <h4>$response</h4> </body> </html> EOF

In reply to sorting out HTTP results by bigup401

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.