Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Perl (http://www.programmingforums.org/forum21.html)
-   -   Interpolation (http://www.programmingforums.org/showthread.php?t=13949)

hush Sep 11th, 2007 1:47 PM

Interpolation
 
I was learning hashes and one part has really confused me. I think that i may have misunderstood the concept of interpolation.

I wanted to print a value in the hash table so i used the code:

:

print "$family_name{$given_name}\n";

what I would expect however is the code to be as followed:

:

print "$family_name{“$given_name”}\n";

As i am referencing the value of the variable “given_name” rather then the variable itself; thus i would expect the double quote marks so that the variable is interpolated (
and the value of the variable is used in the expression ).

I hope that this makes sense. I will be happy to clarify any points that are unclear.

fahlyn Nov 1st, 2007 8:20 PM

Re: Interpolation
 
what exactly were you trying to accomplish with the question marks.


All times are GMT -5. The time now is 10:53 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC