Jim Schueler wrote:
There is an obsolete perl feature called indirect references. If you are
thinking of a specific technology, that might be it.
Personally, I would simply change the last line of your code to:
print eval $value ;
Jim Schueler
Motor City Interactive
On Wed, 27 Jul 20
Bowie Bailey <[EMAIL PROTECTED]> wrote on 07/27/2005 01:47:12 PM:
> Exactly right. You can't use a symbolic reference to refer to a lexical
> variable (declared with "my"). Try this code:
>
> $test = 'global test';
> my $test = 'lexical test';
> my $name = 'test';
> $result = $$name;
> print "$
On 7/27/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> ``my'' variables (lexical variables) do not appear in the symbol table at
> run time (as do package variables, whether declared or auto-vivified) and so
> cannot be referenced ``symbolically''. lexical variables are dealt with
> and
PROTECTED] On Behalf Of Greg
> Sent: 27 July 2005 16:11
> To: ActivePerl@listserv.ActiveState.com
> Subject: Variable reference
>
>
> ---INTERNET EMAIL NOTIFICATION---
> This email originates from the Internet and therefore may not be
From: Wayne Simmons [mailto:[EMAIL PROTECTED]
>
> > This is called a "Symbolic Reference". You do it like this:
> >
> > $database_name = "Greg";
> > $text = "database_name";
> > $value = $$text;
> > print $value;
>
> ok this is kinda freaking me out. I got this to work but I fou
In a message dated 7/27/2005 2:31:22 P.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> > This is called a "Symbolic Reference". You do it like
this:> > > > > >
$database_name = "Greg";> > $text =
"database_name";> > $value = $$text;>
> print $value;> > ok this is k
--- Begin Message ---
In a message dated 7/27/2005 12:48:35 P.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> From: Greg [mailto:[EMAIL PROTECTED]> > >
> Sorry if this has been answered before but I am in a quandary.
> > > > I am trying to get the contents of a variable when
t
Why not use a HASH?
%hash = ('database_name' =>
"Greg");
$text = "database_name";
print $hash{$text};
___
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Greg <[EMAIL PROTECTED]> wrote on
07/27/2005 10:10:30 AM:
> I am trying to get the contents of a variable when that variables
name
> is itself in a different variable. For example:
>
> $database_name = "Greg";
> $text = "database_name";
> $value = "\$" . $text;
$value = $$t
oking somewhere different for the two variables?
Are declared "my" variables different then auto-vivified ones somehow?
Does anyone have some insight into why this would be?
-Wayne
> -Original Message-
> From: Bowie Bailey [mailto:[EMAIL PROTECTED]
> Subject: RE: Varia
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Greg
Sent: 27 July 2005 16:11
To: ActivePerl@listserv.ActiveState.com
Subject: Variable reference
---INTERNET EMAIL NOTIFICATION---
This email originates from the
From: Greg [mailto:[EMAIL PROTECTED]
>
> Sorry if this has been answered before but I am in a quandary.
>
> I am trying to get the contents of a variable when that variables name
> is itself in a different variable. For example:
>
> $database_name = "Greg";
> $text = "database_name";
>
Sorry if this has been answered before but I am in a quandary.
I am trying to get the contents of a variable when that variables name
is itself in a different variable. For example:
$database_name = "Greg";
$text = "database_name";
$value = "\$" . $text;
print $value;
I nee
13 matches
Mail list logo