File: obj_storable.pm

package info (click to toggle)
libgo-perl 0.15-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,112 kB
  • sloc: perl: 13,147; sh: 21; makefile: 7
file content (25 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package GO::Handlers::obj_storable;
use base qw(GO::Handlers::obj);
use strict;
use FileHandle;
use Storable qw(store_fd);

sub e_obo {
    my $self = shift;
    my $fh = $self->fh;
    if (!$fh) {
        my $f = $self->file;
        if ($f) {
            $fh = FileHandle->new(">$f") ||
              $self->throw("cannot write to: $f");
        }
        else {
            $self->throw("$self requires file or fh");
        }
    }
    my $g = $self->g;
    store_fd $g, $fh;
    return;
}

1;