X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FScope%2FUpper.pm;h=91219ff91e5b7fcd63cf1027d022412d35bce5d1;hb=3ccbf65d886255fab86d078e7807d78c576290f3;hp=ad0b2364b771be0df38e2791d0f43ec2e3eb6652;hpb=34257ad32ccc3d743ea1c90fa6cc051c7821e82f;p=perl%2Fmodules%2FScope-Upper.git diff --git a/lib/Scope/Upper.pm b/lib/Scope/Upper.pm index ad0b236..91219ff 100644 --- a/lib/Scope/Upper.pm +++ b/lib/Scope/Upper.pm @@ -9,13 +9,13 @@ Scope::Upper - Act on upper scopes. =head1 VERSION -Version 0.09 +Version 0.10 =cut our $VERSION; BEGIN { - $VERSION = '0.09'; + $VERSION = '0.10'; } =head1 SYNOPSIS @@ -144,11 +144,23 @@ will set C<$x> to a reference to the string C<'foo'>. Other sigils (C<'@'>, C<'%'>, C<'&'> and C<'*'>) require C<$value> to be a reference of the corresponding type. When the symbol is given by a string, it is resolved when the actual localization takes place and not when C is called. -This means that +Thus, if the symbol name is not qualified, it will refer to the variable in the package where the localization actually takes place and not in the one where the C call was compiled. +For example, + + { + package Scope; + sub new { localize '$tag', $_[0] => UP } + } - sub tag { localize '$x', $_[0] => UP } + { + package Tool; + { + Scope->new; + ... + } + } -will localize in the caller's namespace. +will localize C<$Tool::tag> and not C<$Scope::tag>. =back @@ -378,6 +390,9 @@ L (standard since perl 5.006). L, L, L, L. +L is a thin wrapper around L that gives you a continuation passing style interface to L. +It's easier to use, but it requires you to have control over the scope where you want to return. + =head1 AUTHOR Vincent Pit, C<< >>, L. @@ -386,7 +401,8 @@ You can contact me by mail or on C (vincent). =head1 BUGS -Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. +Please report any bugs or feature requests to C, or through the web interface at L. +I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT