BEGIN {
use Exporter ();
use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
- $VERSION = 0.11;
+ $VERSION = 0.13;
@ISA = qw (Exporter);
#Give a hoot don't pollute, do not export more than needed by default
@EXPORT = qw ();
push @must_exist, "fdt" if ($self->{read_fdt});
foreach my $ext (@must_exist) {
- croak "missing ",uc($ext)," file in ",$self->{isisdb} unless ($self->{$ext."_file"});
+ unless ($self->{$ext."_file"}) {
+ carp "missing ",uc($ext)," file in ",$self->{isisdb};
+ return;
+ }
}
print STDERR "## using files: ",join(" ",@isis_files),"\n" if ($self->{debug});
# read XRFMFB abd XRFMFP
read($self->{'fileXRF'}, $buff, 4);
- my $pointer=unpack("V",$buff) || croak "pointer is null";
+ my $pointer=unpack("V",$buff);
+ if (! $pointer) {
+ if ($self->{include_deleted}) {
+ return;
+ } else {
+ warn "pointer for MFN $mfn is null\n";
+ return;
+ }
+ }
# check for logically deleted record
if ($pointer & 0x80000000) {
my $mfn = shift || croak "need MFN";
- my $rec = $self->fetch($mfn);
+ my $rec = $self->fetch($mfn) || return;
my $out = "0\t$mfn";
# init record to include MFN as field 000
my $rec = { '000' => [ $mfn ] };
- my $row = $self->fetch($mfn);
+ my $row = $self->fetch($mfn) || return;
foreach my $k (keys %{$row}) {
foreach my $l (@{$row->{$k}}) {
# filter output
- $l = $self->{'hash_filter'}->($l) if ($self->{'hash_filter'});
+ if ($self->{'hash_filter'}) {
+ $l = $self->{'hash_filter'}->($l);
+ next unless defined($l);
+ }
my $val;