my $content = $response->content(); my @content = "$content"; my $introduction = grep (/Game Introduction - Marvel: Avengers Allianc +e/, @content); print "$introduction";

That is the same as saying:

my $content = $response->content(); my @content; $content[ 0 ] = $content; my $introduction = grep( /Game Introduction - Marvel: Avengers Allianc +e/, $content[ 0 ] ); print $introduction;

Or:

my $content = $response->content(); my $introduction = grep( /Game Introduction - Marvel: Avengers Allianc +e/, $content ); print $introduction;

Or more properly:

my $content = $response->content(); my $introduction = $content =~ /Game Introduction - Marvel: Avengers A +lliance/; print $introduction;

In other words, you don't have a list of "lines" in @content, just a single string.

You may want something like:

my @introduction = grep /Game Introduction - Marvel: Avengers Alliance +/, split /^/, $response->content(); print @introduction;

In reply to Re: How to output the words that you want that came thru an html file? by jwkrahn
in thread 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.