The only reason that:
works is because your strings go through an extra interpolation phase when used in a regex.$in_msg =~ s/$config{'startblock'}//g; $in_msg =~ s/$config{'endblock'}//g;
When you say that your variables end up getting set like:
you are wrong. In Perl, "\013" would give you a single character while your values are being read from a file so the values end up being 4 characters like '\013' or "\\013" would give you.$config{'startblock'} = "\013"; $config{'endblock'} = "\034";
If you want \ to mean something special when used in your config file, then you'll have to add code to provide that special meaning. For example:
could be applied to such values to parse \0 octal escapes.s#\\(0[0-7]*)#pack("C",oct($1))#ge
Updated as if via s/octal/oct/ to correct the bug noted by japhy. Thanks, japhy.
- tye (but my friends call me "Tye")In reply to (tye)Re: Octal Weirdness
by tye
in thread Octal Weirdness
by HaB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |