On Fri, 14 Aug 2009, Darren Duncan wrote:

Richard Hainsworth wrote:
Would it be possible to remove the special purpose of \ from strings within IO constructs?


This would mean '\' could be used in naming paths as an alternative to '/', thus allowing windows and unix strings to be equivalent, eg. IO(:path<<{$root-path}/data/new>>) would be equivalent to IO(:path<<{$root-path}\data\new>>)

The usefulness would be most evident for sub-directories as windows and unix have different ways of describing root, viz. 'C:\' versus '/'

I see problems with this considering that \ is quite universally recognized in Perl (and many other languages) as meaning an escape character, and that moreover you generally need to be able to escape characters in any context building a string.

Considering, though, that we're talking about a magic perl quoting syntax, we could offer people the option of the following two:

q:io{C:\Windows} # Does what you want
q:io:qq:{C:\\Windows} # Does the same thing

        Wouldn't that cover the bases pretty well?

        :)


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayl...@wayland.id.au    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----

Reply via email to