expanding variable inside double quotes 
Author Message
 expanding variable inside double quotes

Hi,
I want to expand a variable inside double quoutes which are immediately
followed by the rest of the quoted string.
like
$var1 ="test";
$var2 = "$var1ing"

and get the content of $var2 to "testing"

Is there a control character that I can put inside the quotes after $var1
and before the rest of the string in order to tell perl that the "ing" is
not a part of the variable name.

thanks
Poul Lund J?rgensen



Sat, 28 Jun 2003 23:19:58 GMT  
 expanding variable inside double quotes
Poul Lund J?rgensen wrote in comp.lang.perl.modules:

Quote:
> Hi,
> I want to expand a variable inside double quoutes which are immediately
> followed by the rest of the quoted string.
> like
> $var1 ="test";
> $var2 = "$var1ing"

> and get the content of $var2 to "testing"

  $var2 = "${var1}ing";

--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/



Sun, 29 Jun 2003 01:02:41 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Comma delimited fields with line returns inside a double quote

2. $x{$y} inside double quotes in print problem

3. Comma delimited fields with line returns inside a double quote

4. replace single quote to double quote with an example

5. replace single quote to double quote

6. changing a single quote string to a double quote string

7. performance penalty: bareword, single quoting, double quoting

8. replace single quote to double quote with an example

9. Converting single quoted string to double quoted string

10. quotes & double quotes in perl CGI

11. Single quotes Vs. Double quotes

12. Convert from DOUBLE-QUOTE to SINGLE-QUOTE interpretation

 

 
Powered by phpBB® Forum Software