awwx.ws
The latest version of this hack is lang2

toperl

Convert Arc strings to Perl

(def escape-perl-string (s)
  (ac-scheme:regexp-replace* "[\\\\']" s "\\\\&"))

(def strperl (s)
  (if (ac-scheme:bytes? s)
       ((ac-scheme bytes-append) #"'" (escape-perl-string s) #"'")
       (string                   "'"  (escape-perl-string s) "'")))

strperl converts an Arc string to a Perl string literal that, when used in a Perl program or read with Perl’s eval function, will result in a string in Perl that contains the same value as the original Arc string.

arc> (do (prn (strperl "What's this?"))
         nil)
'What\'s this?'
nil

Get this hack

Download toperl0.arc and also get the hacks it relies on: scheme-values and ac.

Or, using the hackinator:

hack ycombinator.com/arc/arc3.1.tar
  awwx.ws/scheme-values0.patch
  awwx.ws/ac0.hack
  awwx.ws/toperl0.arc

unLicense

This code is in the public domain.

Contact me

Twitter: awwx
Email: andrew.wilcox [at] gmail.com