YUANya

导航

 

数组

#!/usr/bin/envperl

use strict;
use warnings;


my @arr; $arr[2] ="apple" ;print "$arr[3.14-1]\n"; 

#$arr[5_234_567_890] = "abc";print "$arr[1_234_567_890]\n";

##apple
##

my $end = $#arr;my $length = $end +1;print "$length\n";

##3

my $last_one = $arr[ $#arr ];print "$last_one\n";

my $test_last_one = $arr[-1];print "$last_one = $arr[-1]\n";

my $test_other = $arr[-1000000];print "$test_other";
##3
##apple = apple
##Use of uninitialized value $test_other in string at test.pl line 22.
posted on 2019-06-09 23:51  YUANya  阅读(88)  评论(0编辑  收藏  举报