in reply to \ in single quotes (Re: FTP Problems)
in thread FTP Problems

Well, if I were doing this in my own application, I would have tested my solution first and realized the mistake. You're right, though. Heh.

If you ask me, I hate the fact that back-slashes are special at all within single-quoted strings, precisely for this problem. People make the assumption that single-quotes mean no interpolation is done, that they are safe putting whatever they want in the string. Backslashes are essentially ignored/safe except in the case of a second backslash or a single-quote itself. I might argue that backslashes be totally ignored/unspecial in a single-quoted string. Injecting single quotes might be done by doubling them up.

  • Comment on Re: \ in single quotes (Re: FTP Problems)

Replies are listed 'Best First'.
(tye)Re: \ in single quotes (Re: FTP Problems)
by tye (Sage) on Jan 26, 2001 at 22:43 UTC

    Yes, the trailing delimiter being escaped usually becomes obvious quickly. Trying to access a shared disk via '\\host\share\dir\file.ext' can be very hard to debug and can cause you to waste a lot of time.

            - tye (but my friends call me "Tye")