in reply to Re^2: extract string between 2 elements
in thread extract string between 2 elements
# Where's "use strict", "use warnings"? # Where's your error checking for open? if (open(MYFILE,"htmlfile.txt")) { $line = <MYFILE>; # Don't think this regex is going to do what you want. Should pro +bably focus on this first and see if @array contains what you expect. + We might be able to suggest a better regex if we actually saw teh r +eal data. @array = ($line =~ m/<.^>*>/g); print"ARRAY iS @array\n"; for ($i=0;$i<@array;$i++){ print "The Element $i is $array$i\n"; } for ($j=0; $j<@array; $j++){ for ($k=$j+1; $k<@array; $k++){ # What's this you're tryign to do here? if ($array$j eq $array$k){ # Another hrm... print " substring($array$j,$array$k)\n"; } } } }
|
|---|