X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=sherlock%2Fperl%2FObject.pm;h=38a9d2e0f10aec48a00283b176655a14aba7db06;hb=8020078dd0c80b9b6680244c586c8a34c1912682;hp=07f7899cafef815221c687aa1f98a0572a75534a;hpb=da5a2b1f5eb7b04f67473f69763fdf376adc259f;p=eval.git diff --git a/sherlock/perl/Object.pm b/sherlock/perl/Object.pm index 07f7899..38a9d2e 100644 --- a/sherlock/perl/Object.pm +++ b/sherlock/perl/Object.pm @@ -197,10 +197,11 @@ sub read($$@) { my $read_something = 0; my $obj = $self; my $raw; + my $read = $opts{read} ? $opts{read} : sub { my $fh = shift; return $_ = <$fh>; }; if ($opts{raw}) { $raw = $obj->{"RAW"} = []; } - while (<$fh>) { + while ($read->($fh)) { chomp; /^$/ && last; my ($a, $v) = /^(.)(.*)$/ or return undef;