On Mar 2, 2007, at 9:46 AM, Michael G. Vonk wrote:

Hi,

I am getting unexpected results when calling get_value on an attribute that
does not exist within an entry.  My code looks like:

    print "here\n";
    print Dumper($entry->get_value("unknownattribute"));
    print "there\n";

and the results look like:

    % ./get_value.pl
    here
    there
   %

Which is expected. The POD says

get_value ( ATTR, OPTIONS )
Get the values for the attribute ATTR. In a list context returns all values for the given attribute, or the empty list if the attribute does not exist. In a scalar context returns the first value for the attribute or undef if the attribute does not exist.



Dumper() is putting it in a list context, so you get an empty list



Graham.


Reply via email to