A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Perl/perl5/issues/18389 below:

[doc] Request better documentation of "my" · Issue #18389 · Perl/perl5 · GitHub

$ perldoc -f my
    my VARLIST
    my TYPE VARLIST
    my VARLIST : ATTRS
    my TYPE VARLIST : ATTRS
            A "my" declares the listed variables to be local (lexically) to
            the enclosing block, file, or "eval"...

OK but be sure to mention when its OK, and when not:

$ cat e.pl
use strict;
use warnings 'all';
my $e = 1;
my $e = 1;
{
    $e = 1;
    my $e = 1;
}
$ perl e.pl
"my" variable $e masks earlier declaration in same scope at e.pl line 4.

So only one of the three my's is bad.
So perldoc -f my needs to tell the user why. (Don't tell me why.)
Maybe the details are in perlsub. But we aren't using subroutines here,
so the user won't look there on his own.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4