develooper Front page | perl.beginners | Postings from July 2003

RE: Why use symbolic refs?

Thread Previous | Thread Next
From:
Kipp, James
Date:
July 31, 2003 12:02
Subject:
RE: Why use symbolic refs?
Message ID:
EC6C49DE5C846143AA2CE580420E77C302B69DFF@xexwlm05.mbnainternational.com

> 
> 
> > Or am i missing the point?
> 
> Yeah, I think you did.
> 
> 
> This is the real point...
> 
> $x = "foo";
> $$x = 20;    # this sets $foo
> print $foo;  # prints "20"
> print $x;    # still prints "foo"!.
> 
> But like I said, this is usually a bad way of doing things.  
> It is better to
> use a hash when you have dynamic names.
> 
> Rob
> 

Thanks. I will continue on without them :) 


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About