http://qs321.pair.com?node_id=1230552


in reply to [Solved] Avoiding repeated undefs

my ($key, $val) = (split(" ", $_))[0,6]; would work, although you might just as well write:

my @values = split(" ", $_); my ($key, $value) = @values[0,6];
I find the second one more elegant personally

Edit: this is not an exact equivalent though, as davies demonstrated below