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

There is a site that spits out a text file that is created using a CGI program and displayed on a web page... I'm trying to use the get method by going:
$html = get("http://foldtraj.mshri.on.ca/cgi-bin/conform/foldtraj?nums +truc=1&KinemageReader=63&filein=.%2Fdata%2F9_Joey2.trj&save=See&dopt= +r&keepfilein=1&numlock=0"); open (FILE, ">tempdata.dat") or die "could not open this data file"; print FILE $html; close FILE;

.. and then saving the html that I get in a file so that I can manipulate that file.

When I do that, it says that I have an invalid user, since from where I'm running the perl script I don't have the correct cookie information that is needed.

When that address is put directly into a browser, it runs correctly and the text file desired is displayed, since I'm on their site and their cookie is already in my browser...

Is there anyway to have this work by having a cookie of my own or some other way?

Replies are listed 'Best First'.
Re: Acquiring Cookies information for another site...
by RatArsed (Monk) on Jul 03, 2001 at 11:46 UTC
    You're going to need to use the object orientated interface of LWP::Simple instead, so that you can process the cookies, and programmatically log-on/off and retrieve your file. It's much the same way that most of the Net::SMS:: modules do it...

    --
    RatArsed

Re: Acquiring Cookies information for another site...
by voyager (Friar) on Jul 03, 2001 at 08:50 UTC
    Someone wrote an article that had some code that used a cookie. {grin}