in reply to Push + variable argument
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?