Yes, if the $myvar is given a string the problem goes away. I'm confused as it's only asking for an ip address to use to sub in a file with a placeholder.
Asking what? The user? Scraping a web site? Spelunking in a file or system setting? If you can't answer the question then you better sanitise your code and post it. Most likely though it's asking the user and the user doesn't deign to answer.