my $string = "zero one two three"; # from the list $number = (split /\s/, $string)[1]; # This is with anonynmous array $number = [ split /\s/, $string ]->[1];