大头
Table_bottom

标签云
Table_bottom

分类
Table_bottom

日历
二月
28293031123
45678910
11121314151617
18192021222324
252627282912
Table_bottom

评论
Table_bottom

留言
Table_bottom

微博
Table_bottom

热门文章
Table_bottom

随机文章
Table_bottom

豆瓣上谁关注这里
Table_bottom

链接
Table_bottom

搜索栏
Table_bottom

RSS
RSS Link
Table_bottom

功能
Table_bottom

页面
Table_bottom

计数器
464551
Table_bottom

访客统计
Table_bottom

存档
Table_bottom

初学Perl之一

loveisbug posted @ 2008年11月05日 06:28 in 娱乐 with tags Perl , 3305 阅读

开始学习Perl,起由是想做个小工具,用C也可以,一则不急,二则不忙,那就慢慢做。

先下载ActivePerl,5.10.0 Build 1004。CSDN上看人介绍又下了个perl-lint-mode,也不知道怎么用,先放着。再下载EditPlus做编辑器。

我的第一个perl程序问题是:global symbol requires explicit package name at xxx

google这个报错信息,知道了问题所在。程序里用了use strict之后,就必须用our或者my声明变量。为什么呢?找到了这个介绍:Use Strict And Warnings

程序很简单,我只是想试一下命令行参数。

  1. #!/usr/bin/perl
  2. #use strict;
  3. use warnings;
  4.  
  5. $NUM = @ARGV;
  6. print $NUM;
  7.  
  8. #open(TESTFIEL, "test.txt");
  9. while(<>)
  10. {
  11.         print;
  12. }
  13.  


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter