File: Defrost.pm

package info (click to toggle)
libical-parser-perl 1.20-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 596 kB
  • ctags: 24
  • sloc: perl: 298; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# $Id$
use FreezeThaw qw(thaw freeze);

sub defrost {
    my $f=shift;
    local $/=undef;
    open IN, "<$f" or die "Can't open $f, $!";
    my $s=<IN>;
    close IN;
    return (thaw($s))[0];
}
sub ice {
    my($f, $h)=@_;
    print STDERR "Dumping $f\n";
    open OUT, ">", $f or die "Can't open $f, $!";
    print OUT freeze($h);
    close OUT;
}
1;