LexAlias - Online Linux Manual PageSection : 3
Updated : 2022-01-21
Source : perl v5.34.0
Note : User Contributed Perl Documentation

NAMEDevel::LexAlias − alias lexical variables

SYNOPSIS​ use Devel::LexAlias qw(lexalias); ​ ​ sub steal_my_x { ​ my $foo = 1; ​ lexalias(1, '$x', \$foo); ​ } ​ ​ sub foo { ​ my $x = 22; ​ print $x; # prints 22 ​ ​ steal_my_x; ​ print $x; # prints 1 ​ }

DESCRIPTIONDevel::LexAlias provides the ability to alias a lexical variable in a subroutines scope to one of your choosing. If you don't know why you'd want to do this, I'd suggest that you skip this module. If you think you have a use for it, I'd insist on it. Still here? lexalias( $where, $name, $variable ) $where refers to the subroutine in which to alias the lexical, it can be a coderef or a call level such that you'd give to caller $name is the name of the lexical within that subroutine $variable is a reference to the variable to install at that location

BUGSlexalias delves into the internals of the interpreter to perform its actions and is so very sensitive to bad data, which will likely result in flaming death, or a core dump. Consider this a warning. There is no checking that you are attaching a suitable variable back into the pad as implied by the name of the variable, so it is possible to do the following: ​ lexalias( $sub, '$foo', [qw(an array)] ); The behaviour of this is untested, I imagine badness is very close on the horizon though.

SEE ALSOpeek_sub from PadWalker, Devel::Peek

AUTHORRichard Clamp <richardc@unixbeard.net> with close reference to PadWalker by Robin Houston

COPYRIGHTCopyright (c) 2002, 2013, Richard Clamp. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
0
Johanes Gumabo
Data Size   :   6,435 byte
man-Devel::LexAlias.3pmBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 187,137
Visitor ID   :     :  
Visitor IP   :   3.147.27.154   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|Devel::LexAlias.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Devel::LexAlias.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|Devel::LexAlias.3pm|43|br══─}─══|'br══─}─══ )         (htmlprn|149|Devel::LexAlias.3pm|43|'br══─}─══ |'br══─}─══ )