[interchange] Allow code references to be stored into the session depending on the

Stefan Hornburg <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit b4ef75656388a5108f49732d26d2c194b036fa26
Author: Stefan Hornburg (Racke) <[email protected]>
Date:   Wed Feb 9 11:57:31 2011 +0100

    Allow code references to be stored into the session depending on the
    environment variable MINIVEND_STORABLE_CODE.

 lib/Vend/Util.pm |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/lib/Vend/Util.pm b/lib/Vend/Util.pm
index d6ae6a9..af44984 100644
--- a/lib/Vend/Util.pm
+++ b/lib/Vend/Util.pm
@@ -688,6 +688,13 @@ eval {
 	die unless $ENV{MINIVEND_STORABLE};
 	require Storable;
 	import Storable 'freeze';
+
+	if ($ENV{MINIVEND_STORABLE_CODE}) {
+		# allow code references to be stored to the session
+		 $Storable::Deparse = 1;
+		 $Storable::Eval = 1;
+	}
+
 	$Fast_uneval     = \&Storable::freeze;
 	$Fast_uneval_file  = \&Storable::store;
 	$Eval_routine    = \&Storable::thaw;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.