1. Interpolation of backslash-escapes
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:
'1<tab>2<tab>3
a b c'
Things I tried were for example
$s= eval('' . "$val"); # (hoping to trigger the normal interpolation) or
$s=~ s/\\(.)/"\\$1"/eg;
but somehow i couldn't get it right ...
Can anybody think of an elegant solution?
Regards,
Peter Daum
2. Escaping backslashes in 'HERE documents'? - Perl
3. Escaping escape characters in variables (in regexs)
Hi all, I've got to replace some characters in Base64 encoded data in a text file but I'm having problems with the s/// operator mainly, I presume, because of the presence of the '/' character in the input data. For example, say I have a file containing the following: <SomeNode>skdsSda3321/2=///==asda==////adasd/213/dw/ASDASd/ad</SomeNode> I can pull out the Base64 here with: $text = m/<SomeNode>(.+?)</SomeNode>/; $base64stuff = $1; Then I try to perform a substitution with: $text =~ s/$base64stuff/hello/; But this doesn't work. Anyone know what I can do to get this to work properly? Thanks, JK
4. hyperlink excel 2007 backslash Internet Explorer 7
5. Perl quoting convention that avoids excessive backslashes
Perl lets you quote strings like this: $foo = qq%This string has both "quotes" and 'apostrophes'%; to avoid excessive backslashing. Does ruby have anything similar? -- We're just a Bunch Of Regular Guys, a collective group that's trying to understand and assimilate technology. We feel that resistance to new ideas and technology is unwise and ultimately futile.
6. problem using backslash on brackets in regular expressions - Perl
7. String is Missing Backslash
Hello I am working on a perl script and inside the script I am building a string. However the backslash does not appear. Here is the code: $DirCommand = "dir".$CurrentDrive.":\ /S"; where $DirCommand = "c" I am expecting the results to be dir c:\ /S but my results are dir c: /S This affects the execution of the command. What did I miss putting in? Thanks, Andrew