在shell script 可以用read 取得使用者輸入的值,那在Perl 裡面怎麼做到這樣的功能呢
我們可以用<>來取得user的input 請看下面的範例:
#!/bin/perl
print "please input value\n";
$input=<>;
chomp $input ;
if (!$input)
{
    print "no input ";
}
else
{
    print "input value is $input ";
}


很簡單吧  !!
arrow
arrow
    全站熱搜

    yuanann 發表在 痞客邦 留言(0) 人氣()