in reply to Push + variable argument

Sorry, I can't really make any sense of your post.

When you push something onto @arr, how should $val be affected?

What do you want to achieve, and how does it not work in your second case? Maybe you shouldn't use single quotes around $str?