in reply to How do I interpolate package name in a fully qualified name?
But seriously, isn't this what objects are for ?:)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 ${$pkg.'::type'}, "\n"; } __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I interpolate package name in a fully qualified name?
by AnomalousMonk (Archbishop) on Apr 21, 2011 at 02:44 UTC | |
by AGhoulDoingPerl (Sexton) on Apr 22, 2011 at 14:37 UTC |