Perl中两个verialbes的串联 [英] Concatenation of two verialbes in perl

查看:89
本文介绍了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 = "


这篇关于Perl中两个verialbes的串联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆