SVN: toys/rsget.pl/RSGet/Processor.pm

sparky sparky at pld-linux.org
Fri Oct 9 18:28:43 CEST 2009


Author: sparky
Date: Fri Oct  9 18:28:42 2009
New Revision: 10737

Modified:
   toys/rsget.pl/RSGet/Processor.pm
Log:
- eval in separate sub to clean namespace


Modified: toys/rsget.pl/RSGet/Processor.pm
==============================================================================
--- toys/rsget.pl/RSGet/Processor.pm	(original)
+++ toys/rsget.pl/RSGet/Processor.pm	Fri Oct  9 18:28:42 2009
@@ -234,12 +234,7 @@
 	pr "sub unify { local \$_ = shift; $opts{unify};\nreturn \$_;\n};\n";
 	pr '\&unify;';
 
-	my $unify;
-	{
-		local $SIG{__DIE__};
-		delete $SIG{__DIE__};
-		$unify = eval $processed;
-	}
+	my $unify = eval_it( $processed );
 
 	if ( $@ ) {
 		p "Error(s): $@";
@@ -267,5 +262,12 @@
 	return ();
 }
 
+sub eval_it
+{
+	local $SIG{__DIE__};
+	delete $SIG{__DIE__};
+	return eval shift;
+}
+
 1;
 # vim:ts=4:sw=4


More information about the pld-cvs-commit mailing list