_irspy_to_zeerex() now checks the IRSPY_SAVE_XML environment variable
authorMike Taylor <mike@miketaylor.org.uk>
Mon, 12 Apr 2010 12:56:39 +0000 (13:56 +0100)
committerMike Taylor <mike@miketaylor.org.uk>
Mon, 12 Apr 2010 12:56:39 +0000 (13:56 +0100)
for itself rather than accepting a parameter that its caller must fill
in from that variable.  Simplifies interface.

lib/ZOOM/IRSpy.pm

index 13e6321..f5df4b5 100644 (file)
@@ -262,7 +262,9 @@ sub _hash {
 
 sub _irspy_to_zeerex {
     my $this = shift();
-    my($conn, $save_xml) = @_;
+    my($conn) = @_;
+
+    my $save_xml = $ENV{IRSPY_SAVE_XML};
     my $irspy_doc = $conn->record()->{zeerex}->ownerDocument;
 
     if ($save_xml) {
@@ -291,7 +293,7 @@ sub _rewrite_record {
     my($conn) = @_;
 
     $conn->log("irspy", "rewriting XML record");
-    my $rec = $this->_irspy_to_zeerex($conn, $ENV{IRSPY_SAVE_XML});
+    my $rec = $this->_irspy_to_zeerex($conn);
 
     # Since IRSpy can run for a long time between writes back to the
     # database, it's quite possible for the server to have closed the