Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    String::Escape 2002.001

    Download button

    No screenshots available
    Downloads: 380  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.8/5)
    18 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Matthew Simon Cavalletto | More programs
    Perl Artistic License / FREE
    March 6th, 2008, 14:42 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    String::Escape description

    A Perl module which contains registry of string functions, including backslash escapes.

    String::Escape is a Perl module which contains registry of string functions, including backslash escapes.

    SYNOPSIS

    use String::Escape qw( printable unprintable );
    # Convert control, high-bit chars to n or xxx escapes
    $output = printable($value);
    # Convert escape sequences back to original chars
    $value = unprintable($input);

    use String::Escape qw( elide );
    # Shorten strings to fit, if necessary
    foreach (@_) { print elide( $_, 79 ) . "n"; }

    use String::Escape qw( string2list list2string );
    # Pack and unpack simple lists by quoting each item
    $list = list2string( @list );
    @list = string2list( $list );

    use String::Escape qw( string2hash hash2string );
    # Pack and unpack simple hashes by quoting each item
    $hash = hash2string( %hash );
    %hash = string2hash( $hash );

    use String::Escape qw( escape );
    # Defer selection of escaping routines until runtime
    $escape_name = $use_quotes ? 'qprintable' : 'printable';
    @escaped = escape($escape_name, @values);


    This module provides a flexible calling interface to some frequently-performed string conversion functions, including applying and removing C/Unix-style backslash escapes like n and t, wrapping and removing double-quotes, and truncating to fit within a desired length.

    Furthermore, the escape() function provides for dynamic selection of operations by using a package hash variable to map escape specification strings to the functions which implement them. The lookup imposes a bit of a performance penalty, but allows for some useful late-binding behaviour. Compound specifications (ex. 'quoted uppercase') are expanded to a list of functions to be applied in order. Other modules may also register their functions here for later general use. (See the "CALLING BY NAME" section below for more.)

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    string functions | backslash escapes | Perl module | registry | string | functions

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM