my $string = 'This is my program'; my @arr = split ' ', $string; print "@arr[-1, 1..$#arr-1, 0]";