# @nums = ('3', '33'); my $word = 2; my @nums = (split(' ', $x))[$word] =~ /(\d+)/g;