use warnings; use strict; use Data::Dumper; # for debugging local $/ = ""; # input separator was newline, but now it's gone -> slurp mode. my $html; while () { $html = $_; } print "Html: $html\n\n"; # just to check that this worked... it works. #Don't do this, you can't use the $1, $2 type special variables. my @matches = $html =~ m|(

(.+))|g; # use | as regex delimitor to avoid leaning toothpick syndrome. print "Dumper\n" . Dumper(\@matches); # bit o debugging #Do this. Then you can access the special vars. while ($html =~ m|(

(.+))|g) { print "match $2\n"; # don't know why this works. $1 doesn't work. Hm... } #outputs #match blah #match foo #match gah #$line =~ m/

(.+)<\/B><\/FONT>/gm; #my $bit_i_want=$1; __DATA__

blah

foo

gah