Hi Monks I'm new here hope you could help me with this..

I recently searched for a code that will read or get the contents of an html file so when I run the code it displayed the html code on the cmd screen.. My problem is how can I show the words that I want to see on the screen... I used grep on the code and there I inserted the word that what I want to appear on cmd.. When I run the code it just displayed number 1 on the screen.. For what I've understand it means that there is a sentence like that based on the grep pattern.

use strict; use LWP::Simple; use LWP::UserAgent; my $ua = new LWP::UserAgent; $ua->timeout(120); my $url='http://www.gamezebo.com/games/marvel-avengers-alliance/walkth +rough'; my $request = new HTTP::Request('GET', $url); my $response = $ua->request($request); my $content = $response->content(); my @content = "$content"; my $introduction = grep (/Game Introduction - Marvel: Avengers Allianc +e/, @content); print "$introduction"; exit 0;

Instead of 1 how can I make that sentence appear? Thank you so much...


In reply to How to output the words that you want that came thru an html file? by stone_ice

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.