I need to know, how many backslashes are in a variable, but with 'print' it gives me unclear output on the Linux console. I use the following code:
$i1 = '1\2'; $i2 = '1\\2'; $i3 = '1\\\2'; $i4 = '1\\\\2'; print "#$i1#$i2#$i3#$i4#\n";
It gives me the following output:
#1\2#1\2#1\\2#1\\2#
The first 2 and the last 2 variables give the same output. But I must know, how many backslashes in a row are in the variable. Any hints?
In reply to print backslash in variable by palinurus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |