Re: Interpolation of backslash-escapes

2006-11-04 Thread Rob Dixon
Randal L. Schwartz wrote: "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Can anybody think of an elegant solution? Rob> eval "qq($val)"; s/elegant/hacky, dangerous, broken/ Consider $val = "), $yourcode_here, (". Old news, out of context, petulant. Rob -- To unsubscribe, e-mail: [EMAIL P

Re: Interpolation of backslash-escapes

2006-11-04 Thread Randal L. Schwartz
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: >> Can anybody think of an elegant solution? Rob> eval "qq($val)"; s/elegant/hacky, dangerous, broken/ Consider $val = "), $yourcode_here, (". -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stonehe

Re: Interpolation of backslash-escapes

2006-11-03 Thread Rob Dixon
Rob Dixon wrote: > > Peter Daum wrote: >> >> I am looking for an way to interpolate backslash-sequences >> within a string with the usual perl semantics, e.g. >> $s='1\t\2\t3\na\ b c' should become: >> '123 >> a b c' >> >> Things I tried were for example >> $s= eval('' . "$val"); # (hoping to trig

Re: Interpolation of backslash-escapes

2006-11-03 Thread John W. Krahn
Peter Daum wrote: > I am looking for an way to interpolate backslash-sequences > within a string with the usual perl semantics, e.g. > $s='1\t\2\t3\na\ b c' should become: > '123 > a b c' > > Things I tried were for example > $s= eval('' . "$val"); # (hoping to trigger the normal interpolation) or

Re: Interpolation of backslash-escapes

2006-11-03 Thread Rob Dixon
Peter Daum wrote: > I am looking for an way to interpolate backslash-sequences within a string with the usual perl semantics, e.g. $s='1\t\2\t3\na\ b c' should become: '123 a b c' Things I tried were for example $s= eval('' . "$val"); # (hoping to trigger the normal interpolation) or $s=~ s/\\(.

Re: Interpolation of backslash-escapes

2006-11-03 Thread Tom Phoenix
On 11/3/06, Peter Daum <[EMAIL PROTECTED]> wrote: I am looking for an way to interpolate backslash-sequences within a string with the usual perl semantics That's what eval does, although you have to build your string with care. Don't let the user put their own data into that string; they can (

Re: Interpolation of backslash-escapes

2006-11-03 Thread D. Bolliger
Peter Daum am Freitag, 3. November 2006 20:26: Hoi Peter, > I am looking for an way to interpolate backslash-sequences > within a string with the usual perl semantics, e.g. > $s='1\t\2\t3\na\ b c' should become: > '123 > a b c' With usual perl semantics, the result is different :-) > Things I t

Interpolation of backslash-escapes

2006-11-03 Thread Peter Daum
I am looking for an way to interpolate backslash-sequences within a string with the usual perl semantics, e.g. $s='1\t\2\t3\na\ b c' should become: '123 a b c' Things I tried were for example $s= eval('' . "$val"); # (hoping to trigger the normal interpolation) or $s=~ s/\\(.)/"\\$1"/eg; but some