Debian Codegraph @

script/mir_works_on

raw
1 #! /usr/bin/perl
2 use Modern::Perl;
3 use autodie;
4 use Perlude;
5 use YAML ();
6 use MARC::MIR;
7 use IO::All;
8
9 my $count=0;
10
11 now {
12 $count++;
13 my $raw = $_;
14 my $rec = eval { from_iso2709 };
15 if ( $@ || !$rec ) {
16 die
17 "error ($@) at record $count"
18 };
19 my $newraw = to_iso2709 $rec;
20 unless ( $raw eq $newraw ) {
21 io('OLD') < keys %ENV;
22 # io('OLD') < $raw;
23 io('NEW') < $newraw;
24 exit;
25 }
26 } iso2709_records_of shift;
27 say "$count record successfully passed";