my $line;
my $content;
open (FN,“D:\PerlDemo\parse.xml”) or die “not found $!“;
while($line= ){
next if $. < 5; last if $. >10; $content.=$line;
}
close(FN);
print “$content \n”;
my $K= ;
my @R =qw (A B C D);
my @m =qw (a b c d);
my @r =qw (h k );
my @j=(@R , @m , @r);
for(@j){
print $_ ."\t";
}
while(my($key,$value) = each @R){
print "key= $key value =$value \n";
}
foreach $index(0 .. $#R){
print "index $index : $R[$index] \n";
}
print @R .“\n” ;
print scalar(@R) .“\n”;
open (FN ,‘<:encoding(UTF-8)‘,"$fileName") ;
open (FN,‘>:utf8‘,“$fileName”) ;
原文地址:http://my.oschina.net/u/946001/blog/293655