in reply to How to output the words that you want that came thru an html file?
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to output the words that you want that came thru an html file?
by stone_ice (Initiate) on May 04, 2012 at 06:17 UTC | |
by NetWallah (Canon) on May 04, 2012 at 06:19 UTC | |
by stone_ice (Initiate) on May 04, 2012 at 07:09 UTC | |
by NetWallah (Canon) on May 04, 2012 at 15:34 UTC | |
by Ea (Chaplain) on May 04, 2012 at 10:27 UTC | |
by Anonymous Monk on May 04, 2012 at 13:22 UTC | |
by tobyink (Canon) on May 04, 2012 at 13:51 UTC |