|No such thing as a small change|
Sending Multiple Content-Typesby Petras (Friar)
|on Jun 20, 2003 at 14:14 UTC||Need Help??|
Petras has asked for the
wisdom of the Perl Monks concerning the following question:
Ang Mga Monks!
I raped this code from BBQ to solve this problem (with thanks to Skeeve, benn and fglock; and yes, dear Skeeve, I learned a whole lot in the process!) I'm still a tried and true newbie for sure, but this was a great learning exercise (with one of the best lessons being How To RTFM. And like all good learning exercises (pmdev, I need a spell checker here!) it's left me with insite into great new things that I should learn. So I've been looking through the POD for CGI and can't find an answer to this question:
This code will send a generated file STDOUT:
The following code will print an HTML "just in case" page:
So the question finally is: How can a script be written to send a file and print an HTML page (or vice versa), or more basically, can a single script send two types of Content-Types or headers?
Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats.