[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] object refs in here docs?



> 
> 
> Is it possible to use the object reference syntax within
> a 'here' document, such as:
> 
> my $html=<<EOT;
> <HTML><HEAD>
> <TITLE></TITLE>
> </HEAD><BODY>
> 
> <A HREF=" $cgi->referer ">
> Go Back!!</A>
> 
> </BODY></HTML>
> EOT
> 
> print $html;
> 
> I've tried curly and square brackets in various places,
> but without any luck.
> 
> TIA
> johnw@imagelinc.com
> 
Without testing this myself, try changing the <<EOT to

           <<"EOT"

This allows variable interpolation within the here document.
The closing EOT should remain as-is.

- Dan Griffin
  dang@cs.brandeis.edu