码迷,mamicode.com
首页 > 其他好文 > 详细

来,试试PERL

时间:2015-01-09 19:18:35      阅读:278      评论:0      收藏:0      [点我收藏+]

标签:

试试,看看能否真的替代AWK,SED这些的。。。

技术分享

#!/usr/bin/perl

print "hello, world!\n";

$line = <STDIN>;
if ($line eq "\n") {
    print "That was just a blank line!\n";
}else {
    print "That line of input was: $line";
}
$count = 0;
while ($count < 10) {
    $count += 2;
    print "count is now $count\n";
}

$madonna = <STDIN>;
if ( defined($madonna) ) {
    print "The input was $madonna";
} else {
    print "No input available!\n";
}

技术分享

来,试试PERL

标签:

原文地址:http://www.cnblogs.com/aguncn/p/4213918.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!