logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

XString - Isolated String helpers from B

Author

       Nicolas R <atoomic@cpan.org>

Description

       XString provides the B string helpers in one isolated package.  Right now only cstring and perlstring are
       available.

Functions

cstring(STR)
       Similar to B::cstring; Returns a double-quote-surrounded escaped version of STR which can be used as a
       string in C source code.

   perlstring(STR)
       Similar to B::perlstring; Returns a double-quote-surrounded escaped version of STR which can be used as a
       string in Perl source code.

Name

       XString - Isolated String helpers from B

Synopsis

        #!perl

        use strict;
        use warnings;

        use Test::More;

        use XString;
        use B;

        is XString::cstring( q[a'string"with quotes] ), B::cstring( q[a'string"with quotes] ), q["a'string\"with quotes"];
        is XString::perlstring( q[a'string"with quotes] ), B::perlstring( q[a'string"with quotes] ), q["a'string\"with quotes"];

        done_testing;

Version

       version 0.005

See Also