From: Mike Taylor Date: Tue, 26 Sep 2006 09:08:09 +0000 (+0000) Subject: Record keeps track of its parent IRSpy object, and uses $irspy->log() X-Git-Tag: CPAN-v1.02~1035 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=bc98b77c07920354da337f6d3f6c31b50ab6616c;p=irspy-moved-to-github.git Record keeps track of its parent IRSpy object, and uses $irspy->log() --- diff --git a/lib/ZOOM/IRSpy/Record.pm b/lib/ZOOM/IRSpy/Record.pm index 7b4125a..1ab5033 100644 --- a/lib/ZOOM/IRSpy/Record.pm +++ b/lib/ZOOM/IRSpy/Record.pm @@ -1,4 +1,4 @@ -# $Id: Record.pm,v 1.12 2006-09-25 14:21:07 mike Exp $ +# $Id: Record.pm,v 1.13 2006-09-26 09:08:09 mike Exp $ package ZOOM::IRSpy::Record; @@ -29,7 +29,7 @@ I<## To follow> sub new { my $class = shift(); - my($target, $zeerex) = @_; + my($irspy, $target, $zeerex) = @_; if (!defined $zeerex) { $zeerex = _empty_zeerex_record($target); @@ -37,6 +37,7 @@ sub new { my $parser = new XML::LibXML(); return bless { + irspy => $irspy, target => $target, parser => $parser, zeerex => $parser->parse_string($zeerex)->documentElement(), @@ -104,8 +105,8 @@ sub append_entry { if @nodes == 0; } - ZOOM::Log::log("irspy", - scalar(@nodes), " matches for '$xpath': using first") + $this->{irspy}->log("irspy", + scalar(@nodes), " matches for '$xpath': using first") if @nodes > 1; $this->_half_decent_appendWellBalancedChunk($nodes[0], $frag);