Perl 学习心得体会

首先是在windows平台上使用,可以下载ActivePerl或者StrawberryPerl,安装后既可以像在linux下进行命令行运行了(没有图形界面,呵呵!)

Predefined Names:http://www.cs.cmu.edu/People/rgs/pl-predef.html

Perl 中的特殊变量 $&, $`,$' ,@_ :http://blog.csdn.net/bjbs_270/archive/2007/09/20/1792360.aspx

下面的内容来时学习《Advanced Perl Programming》

Chapter 1

dynamically and statically allocated storage
anonymous storage
reference and dereference
scalars, arrays, hashes

%sue = (
    
'name' => 'Sue',
    
'age' => '45',
    
'children' => [        #anonymous array
         {    #anonymous hash 1
            'name' => 'John',
            
'age' => '20'
         }
,
         {    
#anonymous hash 2
            'name' => 'Peggy',
            
'age' => '16'
          }
        ]
);

print $sue{children}->[1]->{name};

Chapter 2

http://www.perl.com/doc/FMTEYEWTK/ (http://www.perl.com/doc/FMTEYEWTK/regexps.html)

#two dimension array implement
%foo1 = (a => 10, str => "good");

$a = 0;
$str = 1;
$foo2[$a= 10;
$foo2[$str= "hello";

print "$foo1{str}  ";
print "$foo2[$str]  ";

#complex structure
$student{0001= {
    name 
=> fei,
    course 
=> [] };

print $student{0001}{name};

看到第二章,发现内容是在是太深了,还是先看看《Perl Programming》吧。尤其是正则表达式,一定要好好学习。

正则表达式30分钟入门教程 (相当不错的教程,虽然作者是.Net开发者)
http://unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm

原文地址:https://www.cnblogs.com/ainima/p/6331426.html