my @array = (1, 2, 3, 4, 5);
my @new_array = map { $_ * 2 } @array;
# 输出:(2, 4, 6, 8, 10)
my @array = (1, 2, 3, 4, 5);
my @filtered_array = grep { $_ % 2 == 0 } @array;
# 输出:(2, 4)
my @array = (5, 3, 1, 4, 2);
my @sorted_array = sort { $a <=> $b } @array;
# 输出:(1, 2, 3, 4, 5)
my @array = (1, 2, 3, 4, 5);
splice @array, 2, 0, 6;
# @array 现在为 (1, 2, 6, 3, 4, 5)
my @array = (1, 2, 3, 4, 5);
my $string = join ', ', @array;
# 输出:'1, 2, 3, 4, 5'
my @array = (1, 2, 3, 4, 5);
my @reversed_array = reverse @array;
# 输出:(5, 4, 3, 2, 1)
use List::MoreUtils qw(uniq);
my @array = (1, 2, 2, 3, 4, 4, 5);
my @unique_array = uniq @array;
# 输出:(1, 2, 3, 4, 5)