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

Hi, I am new to Perl and I would like to know how to save data from a form on a webpage to a text file using perl in a windows platform.

Replies are listed 'Best First'.
Re: saving form data to a text file
by gregor42 (Parson) on Apr 21, 2001 at 00:12 UTC
    If you are completely new to PERL & to web servers in general. I would reccomend getting the IndigoPerl distribution. It includes the Apache Web Server in the default installtion. It saves a lot of grief for first-timers. The other major distribution for the Wintel platform is ActiveState. However you will have to install Apache on your own if you go that route. It's not brain surgery & it's a good learning experience...

    Also, as previously mentioned, study CGI.pm.



    Wait! This isn't a Parachute, this is a Backpack!

Re: saving form data to a text file
by arturo (Vicar) on Apr 21, 2001 at 01:40 UTC

    OK, here's a slightly less terse answer:

    Use the object-oriented interface for CGI.pm, and then use the save method of that object to write out all of your data to a file. VERY basic structure:

    use CGI; my $q = CGI->new(); open FILE, "> cgi-data.txt" or die "Can't open file for write: $!\n"; $q->save(FILE); close FILE;

    There's a lot more you'll need to look up to turn this into a useful application, but that should get you started.

Re: saving form data to a text file
by suaveant (Parson) on Apr 20, 2001 at 23:13 UTC
    Read up on CGI.pm

    (Ask a terse question...)
                    - Ant