in reply to If statements while in PRINT
I have a reservation I get into below, but here's another way to do it:
The ternary operator is handy for picking values.print $formdata{$_} ? qq(META NAME="$_" CONTENT="$formdata{$_}">\n) : +'' for keys %formdata;
My reservation is that the http server probably won't know to interpret meta tags as http headers for cgi output. The situation is similar to that for SSI - wrong handler. The solution is to feed your hash to the &CGI::header method.
I reread your question before posting. I think my reservation doesn't apply to your problem, if you are using perl to generate static html pages. I'll let the warning stand, since it may be relevant to others.
After Compline,
Zaxo
|
|---|