411 REFERENCE · Wikibooks
Perl Programming/Keywords/my
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Perl msgsnd ne Keywords
The my keyword
The my keyword is used before a variable declaration and makes the variable lexically in this block, file, or eval. If the user wants that more than one variable is declared in this way, parenthesis are required.
Syntax
my VARIABLE_LIST
my TYPE VARIABLE_LIST
my VARIABLE_LIST : ATTRIBUTES
my TYPE VARIABLE_LIST : ATTRIBUTES
Examples
my ( undef, $min, $hour ) = localtime;
[…]
my $dollars = 123;
See also
eval
Perl msgsnd ne Keywords