Perl中两个verialbes的串联
问题描述:
朋友,
请问任何机构可以指导我如何连接两个变量的值?
我已经用Google搜索了它,发现了很多方法,但是每当我尝试串联时,都会失败.
我尝试了以下几行:
Hi Friends,
Could any body please guide me how to concatenate the value of two variable?
I have Googled for it and found lots ways but whenever I tried to concatenate I got failed.
I have tried the following lines:
print "Enter the name";
$baseStream = <> ;
$b = 1;
$strName = "${$baseStream}_Strm_${b}";
print $strName;
如果输入名称XYZ,则预期输出为:XYZ_Strm_1
但是在命令行中,我的输出为:
XYZ
_Strm_1
我只是不明白为什么输出会分成两行.
请帮帮我.
提前谢谢.
-Nilesh
If I entered the name XYZ then expected output is : XYZ_Strm_1
But in command line I am getting output as :
XYZ
_Strm_1
I just don''t understand why the output is got split in two lines.
Please help me.
Thanks in advance.
-Nilesh
答
baseStream =<> ;
baseStream = <> ;
b = 1 ;
strName =
strName = "