use enum qw(first=1 second); my @foo; @foo[first, second] = qw(hello world);