RE: here tag and internal variable

2005-09-23 Thread Larsen, Errin M HMMA/IT
Frank Geueke, III wrote:
> Thanks for the help with the reverse if and else.  I
> ended up  using a single line forward if on a
> single line.  Now my next question.  I'm using a jumbo
> here tag (I think that's what they're called) to add
> html to a string.  I need to use a variable within the
> tag (done this before, no problem) but I need to have
> text immediately following the variable name.  How do
> I tell Perl that the text is not part of the variable
> name?  Here's my code:
> 
> sub print_html_beginning
> {
> my $html_ref = shift(@_);
> my $get_to_index = shift(@_);
> ${$html_ref} .= <<"___HTML___";
> Content-type: text/html
> 
>  Transitional//EN"
>  "http://www.w3.org/TR/html4/loose.dtd";>
> 
>   
>CONTENT="text/html; charset=iso-8859-1">
>  Hotspot Tracker 
>  HREF="$get_to_indexcss/hotspot.css" TYPE="text/css"
>  MEDIA="screen">
> 
> in the link tag Perl thinks the var name is
> $get_to_indexcss...
> 
> Thanks.  ~Frank
> 

Hi Frank,

In your example, you could escape the '_' (underscore) out.  Like this:

HREF="$get\_to_indexcss/hotspot.css" ...

That seems to work for me.

--Errin


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: here tag and internal variable

2005-09-23 Thread Jeff 'japhy' Pinyan

On Sep 23, Frank Geueke, III said:


text immediately following the variable name.  How do
I tell Perl that the text is not part of the variable
name?  Here's my code:


You wrap the *name* of the variable in braces:

  print "${get_to_index}css/hotspot.css";

--
Jeff "japhy" Pinyan%  How can we ever be the sold short or
RPI Acacia Brother #734%  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %-- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: here tag and internal variable

2005-09-23 Thread Denis
>${$html_ref} .= <<"___HTML___";
> Content-type: text/html
>
>  Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd";>
> 
>  
>  CONTENT="text/html; charset=iso-8859-1">
> Hotspot Tracker 
> HREF="$get_to_indexcss/hotspot.css" TYPE="text/css"
> MEDIA="screen">
>
> in the link tag Perl thinks the var name is
> $get_to_indexcss...

Try ${get_to_index} 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]