4.2.5 pop

由陣列尾端,取出最後一個元素:

#! /usr/bin/perl

@total=(2, 4, 6, 1, 3, 5, "a", "b", "c");

$flast=pop @total;

print "$flast\n"; # 應得到 c

print @total;

# 此時 @total 只剩下 (2, 4, 6, 1, 3, 5, "a", "b");