If you are encoding file names, the double quoted form will
always work, however, you could be clever and use the
plain or single quoted form when possible. From a quick glance
at some file names on the corporate server here, I'd hazard
the following distribution:
85% able to be encoded as plain scalar
13% are acceptable as single quoted (starting with
or containing an indicator)
2% require double quoted (carriage returns, or
other illegal flow characters).
This is the reason why we have different scalar styles; To make
the common cases look the best (plain), the not-so-common cases
easy to manage (single quoted), and the uncommon cases
possible (double quoted).
On Fri, Jun 11, 2004 at 06:03:12AM -0700, Rich Morin wrote:
| I had the impression that quoted strings couldn't go past a line break.
| Though I suppose I could use \n or somesuch...
"Like single quoted scalars, double quoted scalars may span multiple
lines, resulting in a single space content character for each line
break. If the line break is escaped, any white space preceding it is
preserved, and the line break and any leading white space in the
continuation line are discarded."
Yes, you'd use \n in the content when ever a line break needs
to be represented. Another thing to point out,
Clark C. Evans Prometheus Research, LLC
Chief Technology Officer Turning Data Into Knowledge
(main) 203.777.2550 (cell) 203.444.0557