in reply to Variable scope issue- effect of "my" on hash ref keys, values
in thread Behaviour of parsed XML
Why would the "extra fun" bit be in the output? You declared two separate $x variables and they're each references to different hashes. If you put data into one hash, it shouldn't appear in the other one.
The only arguable improvement which could be made to Perl with regard to this, is that my $x->{a}->[0] is kinda weird and might be worth warning about. Really that's just a precedence thing though. my is higher precedence than the deref operator, so it just means (my $x)->{a}->[0].
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Variable scope issue- effect of "my" on hash ref keys, values
by parv (Parson) on Feb 26, 2020 at 13:24 UTC |