Subject: | hash de-ref in double quoted string |
Hash derefs don't work in quoted strings.
Here are some cases but the .pm is loaded with them.
#diff -urNp GoogleMaps.org.pm GoogleMaps.pm
--- GoogleMaps.org.pm 2007-03-23 16:44:40.000000000 -0400
+++ GoogleMaps.pm 2007-03-23 16:44:16.000000000 -0400
@@ -346,19 +346,19 @@ sub render {
$this->{height},
);
- my $text = <<SCRIPT;
+ my $text = q{
<script type=\"text/javascript\" />
//<![CDATA[
if (GBrowserIsCompatible()) {
- var map = new GMap2(document.getElementById("$this->{id}"));
-SCRIPT
- $text .= " map.setCenter(new GLatLng($this->{center}[0], $this->
{center}[1]));\n"
+ var map = new GMap2(document.getElementById("}. $this->{id}. q
{"));
+};
+ $text .= " map.setCenter(new GLatLng(". $this->{center}
[0]. ", ". $this->{center}[1]. "));\n"
if $this->{center};
- $text .= " map.setZoom($this->{zoom});\n"
+ $text .= " map.setZoom(". $this->{zoom}. ");\n"
if $this->{zoom};
- $text .= " map.setMapType($this->{type});\n";
+ $text .= " map.setMapType(". $this->{type}. ");\n";
if ($this->{controls}) {
foreach my $control (@{$this->{controls}}) {