Dear colleagues,
I upgraded XML::LibXML from 1.x to 2.x and now all its objects return their textContent() when no methods are given.
I've got used to log object's class names with their unique identifiers, so now I can't just say something like: $log->trace("Information has been loaded as $dom");
ow to get object's name and ID?
Thank you!
P.S. Updated:
sub mm_sprintify { my($message, @values) = @_; return($message) unless(@values); for(my $i = 0; $i < @_; $i++) { given($values[$i]) { when(undef) { $values[$i] = "< undef >"; } when(blessed($_)) { $values[$i] = sprintf("[%s\@0x%x +]", blessed($_), refaddr($_)); } when(ref($_) eq 'HASH') { $values[$i] = Dumper($_); } } } return(sprintf($message, @values)); }
So, now I say $log->debug("The %s %s is loaded as %s", $element_name, $element_type, $element_dom); and feeling quite happy.
In reply to How to use object's reference in "object" context if being used in scalar context it does something wrong? by v_melnik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |