Name : perl-Sub-Uplevel
| |
Version : 0.2800
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 1.62
| Date : 2024-08-05 17:21:42
|
Group : Development/Libraries/Perl
| Source RPM : perl-Sub-Uplevel-0.2800-1.62.src.rpm
|
Size : 0.05 MB
| |
Packager : (none)
| |
Summary : Apparently run a function in a higher stack frame
|
Description :
Like Tcl\'s uplevel() function, but not quite so dangerous. The idea is just to fool caller(). All the really naughty bits of Tcl\'s uplevel() are avoided.
*THIS IS NOT THE SORT OF THING YOU WANT TO DO EVERYDAY*
* *uplevel*
uplevel $num_frames, \\&func, AATTargs;
Makes the given function think it\'s being executed $num_frames higher than the current stack level. So when they use caller($frames) it will actually give caller($frames + $num_frames) for them.
\'uplevel(1, \\&some_func, AATT_)\' is effectively \'goto &some_func\' but you don\'t immediately exit the current subroutine. So while you can\'t do this:
sub wrapper { print \"Before\ \"; goto &some_func; print \"After\ \"; }
you can do this:
sub wrapper { print \"Before\ \"; my AATTout = uplevel 1, &some_func; print \"After\ \"; return AATTout; }
\'uplevel\' has the ability to issue a warning if \'$num_frames\' is more than the current call stack depth, although this warning is disabled and compiled out by default as the check is relatively expensive.
To enable the check for debugging or testing, you should set the global \'$Sub::Uplevel::CHECK_FRAMES\' to true before loading Sub::Uplevel for the first time as follows:
BEGIN { $Sub::Uplevel::CHECK_FRAMES = 1; } use Sub::Uplevel;
Setting or changing the global after the module has been loaded will have no effect.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-S/openSUSE_Tumbleweed/noarch |