Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Perl (https://www.askmehelpdesk.com/forumdisplay.php?f=453)
-   -   Escaping a Vertical Tab (https://www.askmehelpdesk.com/showthread.php?t=355952)

  • May 20, 2009, 06:18 AM
    YankeeFan
    Escaping a Vertical Tab
    Greetings
    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 csodata-csv.pl 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
    YankeeFan
    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 02:04 AM.