[PerlChina] 请教perl cgi页面如何显示ls信息

purl lamp lamp.purl at gmail.com
Wed Jun 4 20:45:47 PDT 2008


maybe the problem is about $HOME
whose home? shall perl work as bash (read the .bashrc to get it)?

2008/6/5 gary.jsz <gary.jsz at gmail.com>:

>   我的代码如下:
>  #!/usr/bin/perl -w
> #
>  use strict;
> use utf8;
>  #use CGI qw/:standard/;
> use CGI qw/:all/;
>  print header,
>         start_html("Mailing list manager system page"),
>         h1('Maillist&#31649;&#29702;&#31995;&#32479; '),
>         start_form,
>         "What are you doing?",
>         popup_menu(-name=>'choose',
>                    -values=>[qw(select create delete modify)]),p,
>         submit,
>         end_form,
>         hr;
>  if(param()){
>         if (em(param('choose')) =~ /select/){
>                 system "date";
>                 print `ls -l \$HOME`;
> #system "ls -l \$HOME"
>         }
>         if (em(param('choose')) =~ /create/){
>                 system "date -u";
>
>         }
>  }
>
> 其中时间能正确显示,但是,就是不能打印 ls -l $HOME 这行,换成 system "ls -l
> \$HOME"也不能打印,还希望各位老师能指教,谢谢!
>
> ------------------------------
>   Gary.jsz
>
>
> _______________________________________________
> China-pm mailing list
> China-pm at pm.org
> http://mail.pm.org/mailman/listinfo/china-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/china-pm/attachments/20080605/06857eb9/attachment.html 


More information about the China-pm mailing list