Hi, monks

I can't realize why my script don't want to save cookies to a file. Can you show me what's wrong?

#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; use HTTP::Cookies; my $cookie_jar = HTTP::Cookies->new; my $ua = LWP::UserAgent->new; $ua->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Ge +cko/20051111 Firefox/1.5"); $ua->cookie_jar( $cookie_jar ); my $KEYWORD_TOOL_URL = "https://adwords.google.com/select/main?cmd=Key +wordSandbox"; my $req = HTTP::Request->new(GET => $KEYWORD_TOOL_URL ); my $res = $ua->request($req); print $cookie_jar->as_string(); $cookie_jar->save("/var/www/html/images/cookie.dat");
And the output is:
Set-Cookie3: S="awfe=X4L006UNsxw:awfe-efe=X4L006UNsxw"; path="/"; doma +in=.google.com; path_spec; discard; version=0 Set-Cookie3: I="X/twsRQBAAA=.XKZGpa+G/d2H+Fw8FQr4PA==.8BjoI2BAzejIcK0I +vz/tOw=="; path="/select"; domain=adwords.google.com; path_spec; disc +ard; version=0
but at this point i have cookie.dat file with this content:
#LWP-Cookies-1.0
Why? Where is mistake?

In reply to Cookies are not saved to disk by Gangabass

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.