From a2834d7c52ba401accfcee956a5d7934448588a8 Mon Sep 17 00:00:00 2001 From: in2 Date: Fri, 31 Oct 2003 01:04:18 +0000 Subject: add loadSerialized git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1282 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- blog/blog.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'blog') diff --git a/blog/blog.pl b/blog/blog.pl index 6b75bc15..dcb272c7 100755 --- a/blog/blog.pl +++ b/blog/blog.pl @@ -14,6 +14,7 @@ use DBD::mysql; use POSIX; use MD5; use Mail::Sender; +use Data::Serializer; use vars qw/@emonth @cnumber %config %attr %article %th $dbh $brdname/; @@ -308,6 +309,20 @@ $comment }); } + # serialized ------------------------------------------------------------- + if( $attr{"$fn.loadSerialized"} ){ + my($obj, %h, $str); + $obj = Data::Serializer->new(serializer => 'Storable', + digester => 'MD5', + compress => 0, + ); + open FH, '<'.$attr{"$fn.loadSerialized"}; + FH->read($str, 104857600); + close FH; + %h = %{$obj->deserialize($str)}; + $th{$_} = $h{$_} foreach( keys %h ); + } + # ¥Î Template Toolkit ¿é¥X mkdir "$BLOGCACHE/$brdname"; $tmpl = Template->new({INCLUDE_PATH => '.', -- cgit v1.2.3