Hi Monks,

I'm trying to use (Merlyn's Basic Cookie Management) script, and it's working, but I have a some questions about it:

1. Creates files under: /tmp/File::Cache, but I'm on a shared webhost, and I'd rather have them under my own local tmp dir, in /home/username/tmp/File::Cache.  How can I change the code to use that path?  I see CGI has a -path switch, but I tried inserting this line:
  -path => '/home/username/tmp',
after line 14 of Merlyn's code, but cache files are still being created in /tmp/File::Cache, and I would have thought that File::Cache controls where they are placed, but I can't see how to change that path in File::Cache.

2. I notice that if the directory structure under /tmp/File::Cache exists, but there are no cache files created in it yet, I get this error when I run the code:
  "Insecure dependency in chdir while running with -T switch at /usr/lib/perl5/5.8.8/File/Find.pm line 751."
How should I get around this error?  I see that removing the "-T" switch from the shebang line avoids it, and changing from File::Cache to Cache::FileCache seems to also, but I'm wondering if there's a better way.

Thanks.


In reply to Merlyn's Basic Cookie Management (1) by tel2

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.