Thread Ersetzen von "\" durch "$\backslash$ (10 answers)
Opened by Gast at 2005-11-29 10:41

pq
 2005-11-29 12:15
#60546 #60546
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
[quote=Relais,29.11.2005, 09:53]so geht's
Code: (dl )
$string =~ s/\\/$\\backslash$/g;
[/quote]
wow, was für eine perl-version hast du denn?
Code: (dl )
1
2
3
4
5
6
perl -wle '$_ = "... \\ ...";
s/\\/$\\backslash$/;
print'
Final $ should be \$ or $name at -e line 3, within string
syntax error at -e line 3, near "s/\\/$\\backslash$/"
Execution of -e aborted due to compilation errors.


edit: typo\n\n

<!--EDIT|pq|1133263448-->
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Ersetzen von "\" durch "$\backslash$