develooper Front page | perl.beginners | Postings from February 2002

Re: need terminology help

Thread Previous | Thread Next
From:
Peter Scott
Date:
February 25, 2002 09:16
Subject:
Re: need terminology help
Message ID:
4.3.2.7.2.20020225090814.00b6d5c0@shell2.webquarry.com
At 11:18 PM 2/24/02 -0800, David Gerler wrote:
>I can't figure out the terminology for what I want to do. I have searched my
>resources for what I think it is with no luck.
>
>Here's what I want.
>
>I want the script to login to a web site. The website will redirect to
>another site with a session id in the url. I need to parse the session id
>out of the url so I can use it in future communications. I have tried
>searching for "parse Url" and a manual search for terms that I think might
>apply. Any help or leads anyone can provide will be appreciated.

Well, you got the terminology right, so I'll press on to implementation.

Use the query_form method from the URI module to get the value you want:

use URI;
$u = URI->new("http://foo.com/bar.cgi?baz=blech&bibble=bubble");
%query = $u->query_form;
print $query{bibble}'

prints "bubble"

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About