Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • \$\begingroup\$ Impressing one, though there is glitch: for ;;#;;; it outputs #5 instead of #2. \$\endgroup\$ Commented May 22, 2017 at 15:24
  • \$\begingroup\$ How did you get this result? echo -n ';;#;;;' | perl -043pe '$_=chr(y%;%%%127)x/#/' | xxd correctly outputs 00000000: 02 on my machine. If you left off the 043, or are using a codepage where # is not ASCII 043, that would explain your result. \$\endgroup\$ Commented May 22, 2017 at 15:27
  • 1
    \$\begingroup\$ Oops. Sorry, I had a typo in my test. Your code works perfectly. \$\endgroup\$ Commented May 22, 2017 at 15:32