http://qs321.pair.com?node_id=469720


in reply to Backtracking

I bet many there are many other better ways;
Here is a quick way; # Global declarations open(spooler,"test.html") or die "Can't open file\n"; while($spool=<spooler>){ $spool; @value=split(/<*>*</,$spool); $i=0;$j=0; while ($i<= $#value) { if ($value[$i] =~ /lt=c24/i ) { $value[$i] =~ s/lt=c24>//g; @val1=split(/ /,$value[$i]); } if($value[$i] =~ /^jtitle>/i) { #$value[$i] =~ s/^jtitle>//ig; $val2[$j]=$value[$i]; $j++; } $i++; } } for($n=0;$n<$j; $n++) { print $val1[$n]." <".$val2[$n]."<jtitle>\n"; }
Hope it helps!