//flex table opened by JP

Click to See Complete Forum and Search --> : Perl Script URL access...


jjinno
07-26-2005, 06:19 PM
Im in search of a way to do the following (Pseudo-Code):

$var = get_URL("http://www.non-localhost.com/something.txt");

Is that doable?

The reason I ask is so that I can create a pseudo-login system, that uses an already existant system.

As a user logs in (just an example) to their webmail like hotmail, there is always a certain portion of the HTML code that would be strictly unique to the logged-in user. Thus I can say (pseudo-code again):


$usr = ask4usr();
$pwd = ask4pwd();

$test = "Some HTML that is unique to the logged in hotmail user";

if ($test eq login2hotmail($usr, $pwd)) { return true; } else { return false; }


Any Ideas?

CompGeek01
07-26-2005, 09:03 PM
If I recall correctly...you should just be able to use fopen($url) to open and read a page like any other.

jjinno
07-29-2005, 01:16 PM
No such luck. Unless you are thinking of PHP, the fopen() function is definately not in the standard set of Perl functions...maybe there is a class that I need to use?

jjinno
07-29-2005, 01:23 PM
The answer is here:

Web Basics with LWP (http://www.perl.com/pub/a/2002/08/20/perlandlwp.html)

I dont know if there is a way to do this with the standard Perl functions, but at least this works beautifully!

Thanks for the help though.