Perl

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”) ;

你可能感兴趣的:(Perl)