i am trying to convert a code of php to perl
in php we use $_cookie[cookiename] to retrieve cookie value
i have to do the same in perl
i have got the cookie some how , but i dont know how to access its value , i tried 3 days banging my head but in vain
second i want to open a URL with the socket im using this code
sub plFetchAlertVal ue($)
{
my ($userId) = @_;
use IO::Socket;
my $query = "http://dev.iventster.c om/pl/publisherCmd.ph p?cmd=hasAlert& userId=$userId" ;
my @url = split(/.com/, $query);
my $host="$url[0].com";
my $path=$url[1];
my $timeout = 5;
my $sock = new IO::Socket::INE T (LocalHost =>$host,LocalPo rt =>80,Proto => 'TCP',Timeout =>$timeout);
die "couldnt connect $!" unless $sock;
but it give the message
(couldnt connect Address already in use) i tried the ip address in $host as 192.168.1.100 and 127.0.0.1 too ,but the same result
would some one guide me to this prblms
in php we use $_cookie[cookiename] to retrieve cookie value
i have to do the same in perl
i have got the cookie some how , but i dont know how to access its value , i tried 3 days banging my head but in vain
second i want to open a URL with the socket im using this code
sub plFetchAlertVal ue($)
{
my ($userId) = @_;
use IO::Socket;
my $query = "http://dev.iventster.c om/pl/publisherCmd.ph p?cmd=hasAlert& userId=$userId" ;
my @url = split(/.com/, $query);
my $host="$url[0].com";
my $path=$url[1];
my $timeout = 5;
my $sock = new IO::Socket::INE T (LocalHost =>$host,LocalPo rt =>80,Proto => 'TCP',Timeout =>$timeout);
die "couldnt connect $!" unless $sock;
but it give the message
(couldnt connect Address already in use) i tried the ip address in $host as 192.168.1.100 and 127.0.0.1 too ,but the same result
would some one guide me to this prblms
Comment