dragonchild has asked for the wisdom of the Perl Monks concerning the following question:
sub output { my $self = shift; # mod_perl 2.x if ( $ENV{MOD_PERL} ) { eval { require Apache::IO; Apache::IO->import; }; if ($@) { die "Cannot figure out what to do under Apache!\n"; } tie *XLS, 'Apache::IO'; binmode *XLS; return $self->write_file(\*XLS); } # mod_perl 1.x (or CGI under mod_perl 2.x) elsif ( $ENV{GATEWAY_INTERFACE} ) { my $module_name; eval { require Apache; Apache->import; $module_name = 'Apache'; }; if ($@) { die "Cannot figure out what to do under Apache!\n"; } tie *XLS, $module_name; binmode *XLS; return $self->write_file(\*XLS); } # CGI (or non-WWW) behavior else { $self->write_file('-'); } }
------
We are the carpenters and bricklayers of the Information Age.
The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6
... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Spreadsheet::WriteExcel under mod_perl 2
by perrin (Chancellor) on Nov 20, 2003 at 19:23 UTC | |
by dragonchild (Archbishop) on Nov 21, 2003 at 14:02 UTC | |
by perrin (Chancellor) on Nov 21, 2003 at 17:32 UTC | |
|
Re: Spreadsheet::WriteExcel under mod_perl 2
by jmcnamara (Monsignor) on Nov 21, 2003 at 11:28 UTC |