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

I'm new to the perl scripting and need some quick help. I'm using Windows XP, Internet Explorer, and Visual FoxPro. I would like to read in a variable from a web page. I can view the source and get the variable name but I need to do this via Perl. I would also like to determine if the web page has completed opening. Does Perl also allow for selecting the windows focus? I will need to move from one window to another. Thanks

Replies are listed 'Best First'.
Re: Accessing HTML var using Perl
by matija (Priest) on Mar 22, 2004 at 17:07 UTC
    When you say you need to read a variable from a web page, do you mean from a form someone filled out? Simply use the param in CGI.

    Or do you mean that you need to parse the text of some external page to get that value? Then you need to fetch that page with eithe LWP::Simple, LWP::UserAgent, or even WWW::Mechanize with HTML::Parser.

    For matters dealing with focus, you need to either use Javascript (for things that will run on arbitrary client machines), or, if the script will be working with local windows, Win32::OLE.

Re: Accessing HTML var using Perl
by tinita (Parson) on Mar 22, 2004 at 17:06 UTC
    what do you mean by HTML variable?
    probably it can be done with client side PerlScript, but i doubt you mean that.
    to "communicate" from a HTML page to a server side perl script (via CGI) one usually uses HTML forms with fields or via a link. please elaborate what you want to do.
    seeing if a page has finished loading is also only possible with client side scripting.
    update:: or have a look at the CGI section in Tutorials, e.g. Setting up Perl/CGI with Windows