in reply to Re^2: slashes in single-quoted string
in thread slashes in single-quoted string

IMHO it's impossible to disable "escaping" and allowing arbitrary character sequences.

I mean by using an alternate delimiter like q{} or q// the problem is just postponed.

DB<105> print q{\}} }

Then the only possibility left would be concatenating with a constant representing the delimiter:

 eval( '$string=' . QUOTE . 'abc' . QUOTE );

instead of  eval( '$string=\'abc\'' );

Possible ... but desirable?

Cheers Rolf

UPDATE: or eval( '$string=' . q{'} . 'abc' . q{'} );

Replies are listed 'Best First'.
Re^4: slashes in single-quoted string
by Eliya (Vicar) on Apr 29, 2011 at 22:59 UTC
    by using an alternate delimiter like q{} or q// the problem is just postponed

    Postponed until when — the unlikely event that all possible delimiters also do occur within the string itself?

    For most practical purposes, this likely wouldn't be an issue (or less of an issue that having to remember to take care of the special cases \\ and \<DELIMITER>).  And in those remaining few cases, you could still resort to concatenation, as you're saying.

    But why write silly things like '$string=' . q{'} . '}' . q{'} as long as can simply say q|$string='}'| ?

    That said, I personally don't really have problems with the way it's implemented currently.