in reply to Re: Printing a Tag content
in thread Printing a Tag content

Thanks,

Is this code of yours to go into the while loop of mine?? if note, the file with the tags is in a .txt file and I will need to open it and read the various lines. So, how do go about doing this.

Edman

Replies are listed 'Best First'.
Re^3: Printing a Tag content
by codeacrobat (Chaplain) on Apr 03, 2006 at 21:23 UTC
    No sorry. I was describing a way to read the xml from STDIN. If you want it using your $kwords file then use following version.
    open SEARCH, "<$kwords" or die "can't open $kwords $!\n"; { local $/=undef; $_ = <SEARCH>; my @arr = split /(<MS_.>)/; shift @arr; # 1st element stuff before <MS_1>, so shift away my %hash = @arr; print map {($_, $hash{$_})} grep { $hash{$_} =~ $word } keys %hash; } close SEARCH;
      Thanks you. And Thanks to all other monks for their assistance