#### Cut, subroutine from module foreach my $tid (@completed){ # does an XML interpretation already exist? my $cache_file = "/xmldumps/$tid.xml"; my $fhh; my $flag; if(-e ($cache_file)){ open($fhh, "<$cache_file") || die "Boom $!"; $results{$tid} = XMLin($fhh); close($fhh); }else{ $results{$tid} = $self->Complex_Crap($tid); $self->Save_XML($tid,$results{$tid}); } } $self->Results(\%results); return($self); } sub Save_XML { my ($self,$tid) = @_; # Save XML representations of data to file system my $cache_file = "/xmldumps/$tid.xml"; my $file_handle; open($file_handle,"> $cache_file"); my $data_representation = XMLout($object); print $file_handle $data_representation; close($file_handle); }