in reply to How to copy an list from a reference hash?
Running this with use strict reveals a helpful error:
in the line containing @e = $@{$P{'E'}};Global symbol "%P" requires explicit package name
$P is a reference, whereas $P{'E'} refers to a simple hash variable, called %P. Since you wish to use the reference, you will need to dereference it back to the hash %$P, using either:
or$$P{'E'}
$P->{'E'}
Now, since that is also a reference to an array, you will need to dereference that with;
So the line which strict reports in error should be:@{$P->{'E'}}
Hope that helped,@e = @{$P->{'E'}};
|
|---|