1) Can I use this module in order to store my hash between sessions

It might mostly work, but it's not at all advisable. Caches are there to speed up lookups that would otherwise take longer, but they are not intended to keep always all information. (It's not the primary goal to avoid data loss, as opposed to "real" storage solutions).

for sessions there's CGI::Session or Storable, depending on the abstraction level you want.

In the CPAN tutorial I found an example of usage. What are $name and $customer there.

$customer is a data structure to be cached, and $name is a name uniquely identifying that structure.

3) Can somebody who has a similar task give me an example of working usage.

Most CPAN modules come with test files which are also working examples. You can find them by clicking on the MANIFEST link on the distribution overview page, for Cache::Cache it's here.


In reply to Re: Cache::Cache questions by moritz
in thread Cache::Cache questions by vit

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.