in reply to system call and newline interpretattion.
I'd check that $_ doesn't already have a newline on the end (see perldoc -f chomp).