<TR> <p> FOO BAR </p> <a href=www.yahoo.com>yahoo</a> </TR>This format follows throughout the file, and only the line that says FOO BAR is searchable, but I want to return that line and the line after (and hypothetically, the line after that, and after that and so on...) when a search is confirmed. Here's my problem: I can find the line with the "hit" just fine, but for the life of me, I can't make perl notice the </TR> tag. here's a sample of the code I am trying to make work:
my $trString = "</TR>";
while ( <DATAFILE> )
{
chomp;
if ( /$content/ )
{
$searchString .= $_;
until ( /$trString/ )
{
chomp;
$searchString .= $_;
}
print "<TR>$searchString";
}
}
I have tried numerous things, messing with flags, etc, and I couldn't get it to work.. can someone help?
Worth noting: I'm a newbie at perl and have programmed in java/c/basic my entire life, so please be patient if this looks like garbage to you. Thanks! In reply to File/String search... by Sharky_The_Dog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |