I have a $subscribers scalar, which can be undef, a reference to HASH, or a link to ARRAY. I assigned sample values $VAR1 , $VAR2 and $VAR3 for testing.
I'm only interested in $subscribers when this is a link to ARRAY, where it will contain multiple values. In other cases, I do not need to print anything (for example, when $subscribers=$VAR2;
The code seems to work under Perl v5.16.2; however, when I move it to the target machine with Perl v5.8.8, I get a compilation error :
% ./test.pl Type of arg 1 to keys must be hash (not private variable) at ./test.pl line 23, near "$subscribers) " Execution of ./test.pl aborted due to compilation errors.
Code below:
arrays perl perl-data-structures hash ref
hq
source share