package meinpaket; use strict; use Tie::File; my @a = (); sub new { my $c = shift; my $s = {}; my %p = @_; $s->{'file'} = $p{'file'}; tie @a, 'Tie::File', $s->{'file'}, memory=>10000 or return 0; $s->{a} = \@a; bless $s, $c; return $s; } sub DESTROY { my $s = shift; untie @{$s->{a}}; } sub get { my $s = shift; my @r = (); foreach (@_) { push @r, ${$s->{a}}[$_]; return \@r; } sub set { my $s = shift; my %p = @_; foreach (keys %p) { ${$s->{a}}[$_] = $p{$_}; } return 1; }