in reply to How can you split inside pop?

pop only works on an array. It doesn't make sense to give pop a list as argument, as its main purpose is to modify the array. You can't modify a list.

In your first code piece, after the pop, you are left with @str containing "this", "is" and "a". The other piece of code doesn't have a @str. If all you care about is the last element of the split, there's no need for a pop at all:

print +(split /\s/ => $str) [-1];
That prints the last element of the list remaining after the split.

Abigail