On Monday, Nov 10, 2003, at 13:16 US/Pacific, Rajesh Dorairajan wrote: [..]

my ( $Host, $Port ) = @_; my $url = "$Host:$Port"; #Does not work #my $url = "http://servername:80"; #This works

    require LWP::UserAgent;
    my $ua = LWP::UserAgent->new(env_proxy => 0,
                              keep_alive => 0,
                              timeout => 30,
                             );

$response = $ua->get( $url );
[..]

since you are planning to use the LWP user agent,
and, you want to look at ONLY the 'host_port' top most
connection, then why not think about it in terms of

my ($host, $port, $path) = @_

        my $url = "http://$host";;
        $url .= ":$port" if $port;
        $url .= $path if $path;

notice that in this case you would be 'golden' with

        get_from_server('www.wetware.com');
        get_from_server('www.wetware.com','80');
        get_from_server('www.wetware.com','80','/drieux/PR/blog2/');

Then if you decide that you want to manage schema other then http
you could modify it with say

my ($host, $port, $path, $schema) = @_

        my $url = $schema || 'http';
        $url .=  "://$host";
        ...

ah whala!

ciao
drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to