Perl-Sensitive Sunglasses | |
PerlMonks |
Re^2: Why won't say act like say when its tied?by ELISHEVA (Prior) |
on Mar 07, 2011 at 17:51 UTC ( [id://891871]=note: print w/replies, xml ) | Need Help?? |
print appends the value of $\ to the end of whatever is passed to print, so if $\="***\n", then {print "hello", "\n"; } outputs "hello\n***\n" not plain "hello\n". That's why it is important for say to set local $\="\n" and not just add "\n" to the end of the list of things to print. Hope that helps.
In Section
Seekers of Perl Wisdom
|
|