perl 输入

#!/usr/bin/perl
$line = <STDIN>;
if ($line eq "\n") {
print "that was just a blank line!\n";

} else {
print "that line of input was :$line";

}

 

 

#!/usr/bin/perl
$madonna = <STDIN>;

if (defined ($madonna))
  {
    print "the input was $madonna";
  }
else
  {

    print "no input available!\n";
  } 

posted @ 2010-07-27 14:56  waynechen  阅读(188)  评论(0编辑  收藏  举报