字符串连接不起作用perl(perl 5.10)

时间:2013-10-24 11:19:06

标签: perl string-concatenation

my $url =
'http://www.ceo.kerala.gov.in/electoralroll/edetailListAjax.html?distNo=&
lacNo=&electorName=&houseName=&epicNo='.$card_number.'&relationName=&sEcho=1&iColumns=8&sColumns=&iDisplayStart=0&iDisplayLength=10&iSortingCols=1&iSortCol_0=0&sSortDir_0=asc&bSortable_0=false&bSortable_1=false&bSortable_2=false&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=false&bSortable_7=false&undefined=undefined';

打印时我刚刚开始

&relationName=&sEcho=1&iColumns=8&sColumns=&iDisplayStart=0&iDisplayLength=10&iSortingCols=1&iSortCol_0=0&sSortDir_0=asc&bSortable_0=false&bSortable_1=false&bSortable_2=false&bSortable_3=false&bSortable_4=false&bSortable_5=false&bSortable_6=false&bSortable_7=false&undefined=undefined

即使我使用加入但答案是一样的,请帮我解决这个问题。

1 个答案:

答案 0 :(得分:4)

如果$card_number = "\r"连接之前的"\r"$card_number = ""将光标放在终端上的行的开头,则可以这样做。在设置url之前放置{{1}}后测试代码。