[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] CGI Filehandle weirdness


This isn't strictly a cgiapp question, but it's close enough for me :)
I'm sure someone here has dealt with it.

I want to be able to take an uploaded file and pass it through
Text::CSV_XS to get my data.

problem: CGI gives me (through it's upload() interface) a blessed "Fh"
object.  (Which looks to be defined inside CGI.pm)

Text::CSV_XS wants an IO::Handle.  IO::Wrap, which would normally handle
things, won't touch blessed objects outside of the core Filehandle/IO
camp.  

The options that come to mind are to:
1) Just copy the data out of the Fh handle to somewhere I can use it.
2) Write my own wrapper like IO::Wrap for this.
3) pull the info for the tempfile this data is sitting in out of CGI and
open a second filehandle to it.
4) unbless the reference.

I say "Ick" to all of these.  Surely someone has dealt with this in the
past?  My google searches gave me nada.  Help appriciated.

Thanks!
-- 
SwiftOne  /  Brett Sanger
suppressed   

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.