use strict; use warnings; my @array = qw/1 2 3/; print 'The variable is ' . ( is123(@array) ? '' : 'not ' ) . '[1 .. 3].'; sub is123 { @_ ~~ [ 1 .. 3 ] }