in reply to Assignment and printing at same time?
As other people have suggested, you often should be scoping the string with my when you assign it. What that does is well-explained by Dominus in Coping with Scoping.print $str = <<SEP; This is a string $xyz SEP
|
|---|