AGhoulDoingPerl has asked for the wisdom of the Perl Monks concerning the following question:
What to do :( ???use 5.012; use warnings; package Zelda; our $type = "prince"; package Mario; our $type = "hero"; package Kupa; our $type = "villan"; package main; foreach my $pkg (qw/Zelda Mario Kupa/) { print "$_ is a " . $$pkg::type . "\n"; #ERROR! print "$_ is a " . ${$pkg}::type . "\n"; #ERROR! print "$_ is a " . ${$pkg::type} . "\n"; #ERROR! }
|
|---|