in reply to [Solved] Avoiding repeated undefs
Are equally inelegant entries accepted?
my $str = 'a b c d e f g'; my @two = $str =~/^([^\s]*)(?:(?:\s+[^\s]+){5})\s+([^\s]+)/; # or my ($key, $val) = $str =~ ... print join(",", @two)."\n"; [download]