dReKurCe has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Monks;
I am trying to intropolate a variable from a different package into a here document as follows:
#! /usr/bin/perl; unshift @INC, "/path/to/package"; print "Introplate variables from which package?"; $package=<STDIN>; use $package; print << EOF; This variable: #heres the intropolation I want to effect: $package::variable originates in package $package. EOF
So the problem I am trying to solve is the intropolation of the package name into the $packagename::variable format. What is the most correct approach to solving this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Interpolating Variables as Package Names
by Roy Johnson (Monsignor) on Mar 09, 2005 at 20:22 UTC | |
by dReKurCe (Scribe) on Mar 09, 2005 at 22:31 UTC | |
|
Re: Intropating Variables as Package Names
by crashtest (Curate) on Mar 09, 2005 at 20:22 UTC | |
by gaal (Parson) on Mar 09, 2005 at 20:27 UTC |