Bug in HTTP::Cookies::Netscape->load
Russell Locke (rlocke@hbs.edu)
Wed, 9 Jun 1999 14:22:04 -0400
With help from Kingpin, I have located a bug in the Cookies::Netscape load
function.
Netscape cookie files as well as (this part is important in proving there
is a bug) the Cookies::Netscape save function, uses '\n' for a line
seperator. The Cookies::Netscape load function does not set the line
seperator, therefore the cookie file that gets read in, is not parsed
correctly. So here is the bug fix.
Insert before line:
695 open(FILE, $file) || return;
Insert:
my $whack = $/; # to preserve orig line seperator if it was set
$/ = "\n";
Insert after line:
712 close(FILE);
Insert:
$/ = $whack; # reset line seperator
- Russ
---------------------------------------------------
Of course I don't look busy - I did it right the first time.
---------------------------------------------------
Russell Locke
ITG - Software Engineering
EMail: rlocke@hbs.edu
Phone: 617.495.6994
Fax: 603.688.6053
Internet: www.people.hbs.edu/rlocke
Harvard Business School
Cotting 213
Soldiers Field Rd.
Boston, Massachusetts 02163
USA