Ask Me Help Desk

Ask Me Help Desk (
-   Perl (
-   -   Escaping a Vertical Tab (

  • May 20, 2009, 06:18 AM
    Escaping a Vertical Tab
    I've found many sites that say \v is for a vertical tab. I found one that says it is not recognized as an escape character. I'm using perl v5.8.8 on a windows machine. In my script I cannot use \v, as it doesn't work. Sigh!

    $foo =~ s/\v/' - '/g;

    >> Unrecognized escape \v passed through at line 668.

    Is there any simple work around for this? One site says use s/\\v/' - '/g, but that doesn't work either.

    Thanks for any tips.
  • May 20, 2009, 06:55 AM
    The answer is to use the Hex or Octal code for the ascii character.:

    I choose the octal code for vertical tab: \013, Hex = B
    $foo =~ s/\013/' - '/g;

  • All times are GMT -7. The time now is 04:23 AM.