draxil42 has asked for the wisdom of the Perl Monks concerning the following question:

HI.

I am writing some some code using perl and the CGI module. I am dealing with uploaded plaintext files (using the filefield() form element) and I want to process the data over several form submissions (kinda like a wizard). Is there a sane way of passing the filehandle on to another form, like in a hidden form element?

Is there an approved way of passing this data about? Or am I best of whacking the data in a temp file and just passing the filename along the chain.

Thanks,

Drax.

Replies are listed 'Best First'.
Re: Filehandles & CGI
by PodMaster (Abbot) on Nov 30, 2003 at 17:40 UTC
    Is there a sane way of passing the filehandle on to another form, like in a hidden form element?
    No. Filehandles are (operating) system resources ...  

    Is there an approved way of passing this data about? Or am I best of whacking the data in a temp file and just passing the filename along the chain.
    Sure, the concept is called sessions cpan.

    merlyn has a written gamut of articles on this type of subject => http://www.stonehenge.com/merlyn/

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Filehandles & CGI
by pg (Canon) on Nov 30, 2003 at 17:57 UTC

    Unless there is a need of that filename on the client side, otherwise there is no point to pass it around all the time.

    I prefer thin client, it is the session identifier shall be passed. The session context shall just be maintained and processed on the server side. Of course, you also need to pass whatever is a must to form the next request, but try to reduce this thru careful design.