Re: Variable reference

2005-07-28 Thread Greg
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

RE: Variable reference

2005-07-27 Thread Lloyd Sartor
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 "$

Re: Variable reference

2005-07-27 Thread David Nicol
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

Re: Variable reference

2005-07-27 Thread Hugh Loebner
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

RE: Variable reference

2005-07-27 Thread Bowie Bailey
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

Re: Variable reference

2005-07-27 Thread Williamawalters
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

Fwd: Variable reference

2005-07-27 Thread Williamawalters
  --- 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

RE: Variable reference

2005-07-27 Thread Bullock, Howard A.
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

Re: Variable reference

2005-07-27 Thread Lloyd Sartor
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

RE: Variable reference

2005-07-27 Thread Wayne Simmons
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

RE: Variable reference

2005-07-27 Thread Brian Raven
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

RE: Variable reference

2005-07-27 Thread Bowie Bailey
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"; >

Variable reference

2005-07-27 Thread Greg
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