in reply to well formed XHTML != tag soup

This might be one way
use CGI; if( CGI->http('accept') =~ m'\Qapplication/xhtml+xml\E'i ){ print CGI->header( 'application/xhtml+xml; charset=utf-8 '); } else { print CGI->header( 'text/html; charset=utf-8 '); }
CGI, CGI Programming

Replies are listed 'Best First'.
Re^2: well formed XHTML != tag soup
by CamelDung (Novice) on Jan 07, 2010 at 09:46 UTC
    Greetings "Anonymous Monk", and thank you for your reply.
    Really, you make it look so simple. :) However, I'm still a bit concerned. If I'm not mistaken, I need the "Vary" handle - this is "UA speak", (robots simply ignore it - as do those poking about your web server, looking to do bad things) and gives me something to "grab" onto (Vary handle). Unless I'm mistaken, w/o it, there's nothing to return. The conditional (as you wrote it) is otherwise "spot on".

    Thank you again for taking the time to respond.

    --
    use qw(:perl:always);
    use qw(:perlmonks:daily);

      Then output the Vary: header like you output the Content-Type header.

      need the "Vary" handle

      clue bat + manual = beat it :)

      Sorry, couldn't resist after "handle".

      CGI->header ( -content_type => 'stuff', -vary => 'Accept', -nph => 1, );
        LOL, No apology necessary. :)

        I think that gets it.

        Thank you very much.

        --
        use qw(:perl:always);
        use qw(:perlmonks:daily);