Permalink
Browse files

save previous container data

  • Loading branch information...
kazeburo committed Oct 29, 2010
1 parent 5fc37ff commit 2ed23aaed4ab36eeb897b3cffb7d1405674616c0
Showing with 5 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +3 −3 lib/Scope/Container.pm
  3. +1 −1 t/01_basic.t
View
@@ -9,3 +9,4 @@ Makefile.old
nytprof.out
MANIFEST.bak
*.sw[po]
+*~
View
@@ -13,7 +13,7 @@ my $CONTEXT;
sub start_scope_container {
my $old;
$old = $CONTEXT if defined $CONTEXT;
- $CONTEXT = {};
+ $CONTEXT = { map { $_ => $old->{$_} } keys %$old };
return guard {
undef $CONTEXT;
$CONTEXT = $old if defined $old;
@@ -67,15 +67,15 @@ Scope::Container - scope based container
=head1 DESCRIPTION
-Scope::Container is scope based container for temporary items and Database Connections.
+Scope::Container is scope based container for temporary cache items and Database Connections.
=head1 EXPORTED FUNCTION
=over 4
=item my $guard = start_scope_container();
-=item my $value = scope_container($key:Str[,$val:Str]);
+=item my $value = scope_container($key:Str[,$val]);
=back
View
@@ -22,7 +22,7 @@ sub bar {
{
bar('foo','foo2');
my $sc = start_scope_container();
- ok( ! scope_container('foo') );
+ ok( scope_container('foo') );
scope_container('foo', 'foo3');
bar('foo','foo3');
{

0 comments on commit 2ed23aa

Please sign in to comment.