ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Cache/CacheUtilities.pm
(Generate patch)

Comparing COMP/SCRAM/src/Cache/CacheUtilities.pm (file contents):
Revision 1.4 by sashby, Wed Feb 2 16:33:52 2005 UTC vs.
Revision 1.6 by sashby, Wed Nov 2 17:57:24 2005 UTC

# Line 9 | Line 9
9   # Copyright: 2003 (C) Shaun Ashby
10   #
11   #--------------------------------------------------------------------
12 +
13 + =head1 NAME
14 +
15 + Cache::CacheUtilities - Utilities for reading and writing of cache files.
16 +
17 + =head1 SYNOPSIS
18 +
19 + Reading:
20 +
21 +         print "Reading cached data","\n",if ($ENV{SCRAM_DEBUG});
22 +         $cacheobject=&Cache::CacheUtilities::read($cachename);
23 +
24 + Writing:
25 +  
26 +         &Cache::CacheUtilities::write($cacheobject,$cachename);
27 +
28 + =head1 DESCRIPTION
29 +
30 + Functions for reading and writing of cache files. This uses Data::Dumper to
31 + write out Perl data structures to files. For reading, the complete data structure
32 + is read from the cache file and stored in a variable which is then evalled to
33 + restore the original object.
34 +
35 + =head1 METHODS
36 +
37 + =over
38 +
39 + =cut
40 +
41   package Cache::CacheUtilities;
42   require 5.004;
43  
# Line 22 | Line 51 | use Exporter;
51   # Common functions for interacting with caches:
52   #
53  
54 + =item   C<read($cachefilename)>
55 +
56 + Read the cache file $cachefilename and return a Perl object.
57 +
58 + =cut
59 +
60   sub read()
61     {
62     my ($cachefilename) = @_;
# Line 36 | Line 71 | sub read()
71     return $cache;
72     }
73  
74 + =item   C<write($cacheobject,$cachefilename)>
75 +
76 + Dump the Perl object $cacheobject to a file $cachefilename.
77 +
78 + =cut
79 +
80   sub write()
81     {
82     my ($cacheobject,$cachefilename) = @_;
# Line 66 | Line 107 | sub write()
107     }
108  
109   1;
110 +
111 +
112 + =back
113 +
114 + =head1 AUTHOR/MAINTAINER
115 +
116 + Shaun Ashby
117 +
118 + =cut

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines