X-Git-Url: http://git.rot13.org/?p=Biblio-Isis;a=blobdiff_plain;f=lib%2FBiblio%2FIsis.pm;h=a87994fd9a6797058adab590bef01abfb5ea8bc7;hp=b11e856765a728408dd7e8ad2c806fe52f4bd837;hb=2f79725466971fcc6580b3c69eb330e0ca3c76f8;hpb=76f67433b94bf607e940c25db70cc753e3ffa211 diff --git a/lib/Biblio/Isis.pm b/lib/Biblio/Isis.pm index b11e856..a87994f 100644 --- a/lib/Biblio/Isis.pm +++ b/lib/Biblio/Isis.pm @@ -491,12 +491,26 @@ following structure: This method will also create additional field C<000> with MFN. +There is also more elaborative way to call C like this: + + my $hash = $isis->to_hash({ + mfn => 42, + include_empty_subfields => 1, + }); + =cut sub to_hash { my $self = shift; + my $mfn = shift || confess "need mfn!"; + my $arg; + + if (ref($mfn) eq 'HASH') { + $arg = $mfn; + $mfn = $arg->{mfn} || confess "need mfn in arguments"; + } # init record to include MFN as field 000 my $rec = { '000' => [ $mfn ] }; @@ -662,7 +676,8 @@ You can find version dependencies documented here =item 0.20 -Added C<< $isis->mfn >> and support for repeatable subfields +Added C<< $isis->mfn >>, support for repeatable subfields and +C<< $isis->to_hash({ mfn => 42, ... }) >> calling convention =back