回复 20# sunzhiguolu
this is a small gift , i hope you like it
perl >= v5.20- #!/usr/bin/perl
- use 5.020; # perl >= v5.20
- my %X = qw[ 1 11 2 22 3 33 4 44 5 55 6 66 ];
- my @X = 'A' .. 'K';
- $X{ 1, 2, 3, 4 } = 1234;
- my $a = %X{ 1, 2, 3, 4 };
- my %b = %X{ 1, 2, 3, 4 };
- my @c = %X{ 1, 2, 3, 4 };
- my $d = $X{ 1, 2, 3, 4 };
- my @e = $X{ 1, 2, 3, 4 };
- my %f = $X{ 1, 2, 3, 4 };
- my @g = @X{ 1, 2, 3, 4 };
- my $h = @X{ 1, 2, 3, 4 };
- my %i = @X{ 1, 2, 3, 4 };
- my $j = @X[ 1, 2, 3, 4 ];
- my %k = @X[ 1, 2, 3, 4 ];
- my @l = @X[ 1, 2, 3, 4 ];
- my @m = %X[ 1, 2, 3, 4 ];
- my $n = %X[ 1, 2, 3, 4 ];
- my %o = %X[ 1, 2, 3, 4 ];
- my ($p) = @X[ 1, 2, 3, 4 ];
- my ($q) = %X[ 1, 2, 3, 4 ];
- my ($r) = %X{ 1, 2, 3, 4 };
- my ($s) = @X{ 1, 2, 3, 4 };
- my ($t) = $X{ 1, 2, 3, 4 };
复制代码 |