use strict; use warnings; my ($x, $z) = (split /,/, '7,8,9')[0,2]; print "$x $z\n"; __END__ 7 9