SPUG: Re: HTTP::Cookies question

Richard Anderson richard at richard-anderson.org
Thu Feb 28 15:51:56 CST 2002


You haven't added any cookies to the cookie jar using
HTTP::Cookies::set_cookie.  See perldoc HTTP::Cookies.

On an unrelated note, it is more portable and less error prone to use
use File::Path;
mkpath($newdir)

than
system "mkdir -p $newdir"
since on some OSes mkdir does not have the -p option.

Cheers,
Richard
richard at richard-anderson.org
www.richard-anderson.org
www.raycosoft.com
----- Original Message -----
From: "S Bullo" <sweetsue at sweethomes.com>
To: "Richard Anderson" <richard at richard-anderson.org>; "Seattle Perl User's
Group" <spug-list at pm.org>
Sent: Thursday, February 28, 2002 12:57 PM
Subject: RE: HTTP::Cookies question


> Ok, I changed it to the following:
>
> my $url =
>
"http://$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]&subject=$row[7]&me
> ssage=$row[8]";
> $row[6] =~ s|'s|s|g;
> $row[7] =~ s|#| |g;
> $row[8] =~ s|#| |g;
> my $sec_file_path = "members/data/$row[9]";
> my $data = "members/data/$row[9]/$row[10].html";
> if (! -d "$sec_file_path") { system "mkdir -p $sec_file_path" }
> my $req = HTTP::Request->new(GET=>$url);
> my $domain = $cookie_jar->add_cookie_header($req);
> my $resp = $ua->request($req, $data);
> my $domain2 = $cookie_jar->extract_cookies($resp);
> my $outfile = "index.html";
> my $filename = "$sec_file_path/$outfile";
> open (FILE,">>$filename") or die "Error opening $filename: $!";
> { print FILE "<a href='$row[10].html'>Report on $date for
> '$row[10]'</a><br>"; }
> close (FILE);
> }
>
> Doesn't give me an error but it doesn't seem to be passing any cookies
> through - I am still getting incorrect, correct?
>
>
> Susanne Bullo
>
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org





More information about the spug-list mailing list