返回列表 回复 发帖

比较两种CGI编程风格

  1. #!/usr/bin/perl
  2. use CGI;
  3. #$name= adasas;
  4. $addr= remote_host;
  5. $q= new CGI;
  6. print$q->header(-type=>'text/html',
  7. -charset=>'gb_2132'
  8. );
  9. print$q->start_html(-title=>'test',
  10. -bgcolor=>'#FFffFF',
  11. -author=>'cnangel',
  12. -text=>'#000000');
  13. $q->p('This is what I mean by '),
  14. $q->b('abstracted'),
  15. print$q->end_html();
  16. exit;
复制代码
  1. #!/usr/bin/perl
  2. print "content-type:text/html \n\n";
  3. if(1 eq 1){&eee;exit;}else{print "error";exit;}
  4. sub eee{
  5. print<<EOF
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  9. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  10. <meta name="ProgId" content="FrontPage.Editor.Document">
  11. <title>leoboard</title>
  12. <meta http-equiv="refresh" content="1; url=http://www.leoboard.com/cgi-bin/leoboard.cgi">
  13. </head>
  14. <body>
  15. </body>
  16. </html>
  17. EOF
  18. }
复制代码

                     我是一个呼吸着现在的空气而生活在过去的人
               这样的注定孤独,孤独的身处闹市却犹如置身于荒漠
                                     我已习惯了孤独,爱上孤独
                                 他让我看清了自我,还原了自我
                             让我再静静的沉思中得到快乐和满足
                                   再孤独的世界里我一遍又一遍
                                   不厌其烦的改写着自己的过去
                                             延伸到现在与未来
                                       然而那只是泡沫般的美梦
                                 产生的时刻又伴随着破灭的到来
                         在灰飞烟灭的瞬间我看到的是过程的美丽
                                      而不是结果的悲哀。。。
返回列表