Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Help please! I am writing a search result page to display to metatag of documents. My question is simple, all I need to do is figure out which $triplets{"MetaTag_$i\_$j"} of metaTag contents "description" then display in first order, then "posted" displays second order. since each document written different order of metatag info.
let me repeat my question again:
1. documents are content different order of metatag, I'd like to display in the order I want and not based on HTML document itself.
2. in the same time, I'd like to disaply info when data return "description" from $triplets{"MetaTag_$i\_$j"}, same as "posted", and when "description" not exist then displays $triplets{"Summary_$i"}.
for my $j(1,2){ if(exists($triplets{"MetaTag_$i\_$j"})) { $triplets{"MetaTag_$i\_$j"} =~ s/^description=/Summary: /gi; $triplets{"MetaTag_$i\_$j"} =~ s/^posted=/Posted: /gi; print <<END_OF_HTML; <font size=-1 color="#8f8f8f" face=arial,sans-serif>$triplets{"MetaTag +_$i\_$j"}<br></font> END_OF_HTML } } # Display summary (document snippet) if there is one for my $j(1){ if (!exists($triplets{"MetaTag_$i\_$j"})) { print <<END_OF_HTML; <font color="#000000" size="-1" face=arial,sans-serif><b>Summary:</b>$ +triplets{"Summary_$i"}</font><br> END_OF_HTML } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: return metaTag Info
by n3dst4 (Scribe) on Jan 09, 2002 at 22:42 UTC |