I would have thought that the two must be distinguished at compile time
A lexical var is either always an alias or never an alias, so you can for those. But it's a different story for globals.
sub func { $_ = "foo"; } func() for my $var; # $_ is an alias func(); # $_ isn't an alias
Update: Oops, not even for lexicals if you use Data::Alias. But you could say that if alias is being used, you know you're dealing with an alias.
In reply to Re^6: Changing array by changing $_?
by ikegami
in thread Changing array by changing $_?
by johnvandam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |