Group :: Development/Perl
RPM: perl-Sub-Uplevel
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Current version: 0.09-alt1
Build date: 7 june 2005, 02:12 ( 987.3 weeks ago )
Size: 21.82 Kb
Home page: http://www.cpan.org
License: Artistic
Summary: Sub-Uplevel - apparently run a function in a higher stack frame
Description:
List of contributors List of rpms provided by this srpm:
ACL:
Build date: 7 june 2005, 02:12 ( 987.3 weeks ago )
Size: 21.82 Kb
Home page: http://www.cpan.org
License: Artistic
Summary: Sub-Uplevel - 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
=over 4
=item uplevel
uplevel $num_frames, \&func, @args;
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 caller($frames + $num_frames) for them.
"uplevel(1, \&some_func, @_)" 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\n";
goto &some_func;
print "After\n";
}
you can do this:
sub wrapper {
print "Before\n";
my @out = uplevel 1, &some_func;
print "After\n";
return @out;
}
Current maintainer: Vitaly Lipatov 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
=over 4
=item uplevel
uplevel $num_frames, \&func, @args;
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 caller($frames + $num_frames) for them.
"uplevel(1, \&some_func, @_)" 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\n";
goto &some_func;
print "After\n";
}
you can do this:
sub wrapper {
print "Before\n";
my @out = uplevel 1, &some_func;
print "After\n";
return @out;
}
List of contributors List of rpms provided by this srpm:
- perl-Sub-Uplevel