in reply to Re^3: Global substitution of non-base-plane Unicode characters
in thread Global substitution of non-base-plane Unicode characters
In this case, using printf instead of print is justified and, in fact, smart. The default value of the predefined variable $\ ($OUTPUT_RECORD_SEPARATOR) is undef, which is what Peter wants and expects here. But a very surprising and potentially elusive bug can be introduced into Peter's program when the value of $\ is later changed. Using printf in this admittedly unusual way ensures that the Unicode byte order mark is never followed by any unexpected character such as newline (\n).
Jim
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Global substitution of non-base-plane Unicode characters
by kcott (Archbishop) on Feb 24, 2014 at 04:29 UTC | |
by pjfarley3 (Initiate) on Feb 24, 2014 at 04:44 UTC | |
by Jim (Curate) on Feb 24, 2014 at 17:43 UTC | |
by kcott (Archbishop) on Feb 25, 2014 at 00:30 UTC |