in reply to CGI.pm and filehandle woes
Anyone have any ideas on how to get this working?
As I said in the CB, I've worked around CGI's lightweight, crippled, overloaded file handle by making it inherit from the necessary classes. Assuming the classes are already loaded:
push @Fh::ISA, 'IO::Seekable' unless Fh->isa('IO::Seekable'); push @Fh::ISA, 'IO::Handle' unless Fh->isa('IO::Handle'); my $mimetype = File::MMagic->new->checktype_filehandle($filehandle);
As long as the $filehandle provided by CGI is a globref, blessed to the Fh class, and sysopened on the tempfile (as it is today), this works. Plenty hacky, but it works, at least for File::MMagic.
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI.pm and filehandle woes
by Elijah (Hermit) on Mar 27, 2007 at 19:35 UTC | |
|
Re^2: CGI.pm and filehandle woes
by Elijah (Hermit) on Mar 27, 2007 at 19:20 UTC | |
by Sidhekin (Priest) on Mar 27, 2007 at 19:30 UTC | |
|
Re^2: CGI.pm and filehandle woes
by markjugg (Curate) on Jun 22, 2008 at 12:46 UTC |