in reply to Unifying namespaces of @name and $name to simplify dereferencing?
I think that it would make maint a LOT harder (decreased readability). If people already complein about using the same "name" for variables that are related, this would only worsen that. Personally I'd choose an opt-in to make use of this new hypothetical feature a fatal warning :]
my %name; my @name; sub name { my $name = shift; exists $name{$name} and return $name{$name}; grep { $_ eq $name } @name and return $name; return "invalid"; } # name
FWIW, the above code is fine with me :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unifying namespaces of @name and $name to simplify dereferencing?
by LanX (Saint) on Mar 22, 2016 at 12:29 UTC | |
by shmem (Chancellor) on Mar 22, 2016 at 14:00 UTC | |
by LanX (Saint) on Mar 25, 2016 at 19:43 UTC |