| 1 | package Koha::Contrib::Sudoc::PPNize::Reader; | ||
| 2 | # ABSTRACT: Reader du fichier ABES d'équivalence PPN biblionumber | ||
| 3 | $Koha::Contrib::Sudoc::PPNize::Reader::VERSION = '2.50'; | ||
| 4 | use Moose; | ||
| 5 | |||
| 6 | with 'MooseX::RW::Reader::File'; | ||
| 7 | |||
| 8 | |||
| 9 | sub read { | ||
| 10 | my $self = shift; | ||
| 11 | |||
| 12 | my $fh = $self->fh; | ||
| 13 | |||
| 14 | my $line = <$fh>; | ||
| 15 | return 0 unless $line; | ||
| 16 | |||
| 17 | chop $line; | ||
| 18 | my ($ppn, $biblionumber) = $line =~ /PPN (.*) : (.*)/; | ||
| 19 | return { ppn => $ppn, biblionumber => $biblionumber }; | ||
| 20 | } | ||
| 21 | |||
| 22 | no Moose; | ||
| 23 | __PACKAGE__->meta->make_immutable; | ||
| 24 | 1; | ||
| 25 | |||
| 26 | __END__ |