in reply to Re: Deconstructed array won't return scalar value if integer?
in thread Deconstructed array won't return scalar value if integer?

Yeah, Dumper returns nothing either. Real world code example:
'016' => { 'ind1' => ' ', 'ind2' => ' ', 'subfield' => { 'a' => { 'content' => '2009600369' } } }, '546' => { 'ind1' => ' ', 'ind2' => ' ', 'subfield' => { 'a' => { 'content' => 'English' } } },
Like I said before - 546's content will return English, while 016 will return an uninitialized value

Replies are listed 'Best First'.
Re^3: Deconstructed array won't return scalar value if integer?
by toolic (Bishop) on Nov 29, 2007 at 18:35 UTC
    I wonder if the leading 0 in 016 is causing problems. Perhaps when referencing, you could try to force this number to be a string as follows:
    $gooddata=$record->{datafield}->{'016'}->{subfield}->{a}->{content};
    Just a thought.
      That was exactly it. Thanks again!
        Just to make sure you know why. A number that starts with a zero is treated as octal:
        print 016, "\n"; print "016", "\n"; print 0+"016", "\n"; #Output: #14 #016 #16