problem with code conversion from php to perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • facade21
    New Member
    • Jan 2007
    • 1

    problem with code conversion from php to perl

    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
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    as far as the cookie goes:



    or if you are already doing some CGI stuff you may want to use the CGI module to do all the CGI stuff:

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      as for the rest your question, all I can suggest is you read the corresponding documentation for the module(s):



      but it does look like you have loaded the IO::Socket module but try and create a new object of the IO::Socket::INE T class. But read the docs, I have little experience with those modules.

      Comment

      Working...