Perl example

来源:互联网 发布:python restful框架 编辑:程序博客网 时间:2024/06/06 09:50


print "What is your name? ";chomp($name=<STDIN>);print "Welcome, $name, are you ready to learn Perl now?";chomp ($response=<STDIN>);$response=lc($response);if($response eq "yes" or $response eq "y") {print "Great! Lets go get started learning Perl by example.\n";}else{print "O.K. Try again later. \n";}$now = localtime;print "$name, you ran this script on $now. \n ";

C:\Users\IBM_ADMIN\Desktop\ORACLE\练习\Perl>perl test.plWhat is your name? Michael JWelcome, Michael J, are you ready to learn Perl now?YesGreat! Lets go get started learning Perl by example.Michael J, you ran this script on Tue Jul  9 16:44:31 2013.C:\Users\IBM_ADMIN\Desktop\ORACLE\练习\Perl>perl test.plWhat is your name? Jason BWelcome, Jason B, are you ready to learn Perl now?nO.K. Try again later.Jason B, you ran this script on Tue Jul  9 16:45:00 2013.C:\Users\IBM_ADMIN\Desktop\ORACLE\练习\Perl>


原创粉丝点击