ionarray可以如:
@a=([1,2,3],[4,5,6]);
print$a[1][2];
结果是6.
使用associativearray也类似:
$database{$name}{'home'}{'address'}='No.1234,75thStreet";
$database{$name}{'office'}{'phone'}='02-8127365";
Listofassociativearray也都可以使用.
2.9Example
Email中若有uuencode的资料,可以写perl将它extract出来.
#!/usr/local/bin/perl
open(EMAIL,"<$ARGV[0]")||die"Cannotopen$ARGV[0]:$!";
#若开不成perl会跳出且印Cannotopen...
while(){
if(/^begin\s \d\d\d\s /){
#遇到begin开头後印出
print$_;
while(){
if(/^end/){
#遇到end时结述
last;
}
print$_;
}
print$_;
last;
}
}
close(EMAIL);
可以写得更简化,不过那就属於您功力的无限空间了.........
-----ByPinhongChen--------------------------------------------------------
V1.0Feb11,1996打开:






