[ic] Perl Variable Interpretation (Was: How to access PERL Environment Variables?)

Doug Alcorn doug@lathi.net
10 Nov 2000 10:25:45 -0500

Spencer <spencer@poseidon.mediabang.com> writes:

>     $return .= "$key = ". $Session->{$key} ."<BR>\n";

I've always had a queation about this and my own usage is fairly
inconsistent.  In this assignment, you have quoted the variable $key,
concatenated that quoted string with the variable $Session->{key}, and
finally concatenated another string.  What's the difference between
what you wrote and this:

        $return .= "$key = $Session->{$key} <BR>\n";

(BTW, I tested this to see if it had the same result.  It does.)  Are
there strict rules about what perl can and can't interpolate within
double-quotes?  I imagine there would be some instances where perl
might get confused.
 (__)  Doug Alcorn (mailto:doug@lathi.net http://www.lathi.net)
 oo /  Unix Hacker
 |_/   "It's too late for paradise" (at least in this life)