marc_template
rec1 rec2 rec
- frec
+ frec frec_eq frec_ne
regex prefix suffix surround
first lookup join_with
save_into_lookup
=cut
-our $VERSION = '0.33';
+our $VERSION = '0.34';
=head1 SYNOPSIS
return shift @out;
}
+=head2 frec_eq
+
+=head2 frec_ne
+
+Check if first values from two fields are same or different
+
+ if ( frec_eq( 900 => 'a', 910 => 'c' ) ) {
+ # values are same
+ } else {
+ # values are different
+ }
+
+Strictly speaking C<frec_eq> and C<frec_ne> wouldn't be needed if you
+could write something like:
+
+ if ( frec( '900','a' ) eq frec( '910','c' ) ) {
+ # yada tada
+ }
+
+but you can't since our parser L<WebPAC::Parser> will remove all whitespaces
+in order to parse text and create invalid function C<eqfrec>.
+
+=cut
+
+sub frec_eq {
+ my ( $f1,$sf1, $f2, $sf2 ) = @_;
+ return (rec( $f1, $sf1 ))[0] eq (rec( $f2, $sf2 ))[0];
+}
+
+sub frec_ne {
+ return ! frec_eq( @_ );
+}
+
=head2 regex
Apply regex to some or all values