#!/usr/bin/perl use strict; use warnings; my $ref = [ qw/foo bar buz/ ]; print scalar @{$ref}, "\n";