Giter VIP home page Giter VIP logo

string-dirify's Introduction

NAME
    "String::Dirify" - Convert a string into a directory name

Synopsis
            use String::Dirify;

            my($dir_1) = String::Dirify -> dirify('frobnitz');

    Or:

            use String::Dirify ':all';

            my($dir_2) = dirify('bar baz');

    Or even:

            use String::Dirify;

            my($sd)    = String::Dirify -> new();
            my($dir_3) = $sd -> dirify('!Q@W#E$R%T^Y');

Description
    "String::Dirify" is a pure Perl module.

    This module allows you to convert a string (possibly containing high
    ASCII characters, and even HTML) into another, lower-cased, string which
    can be used as a directory name.

    For usage, see the Synopsis.

    This code is derived from similar code in Movable Type.

Method: dirify($string [, $separator])
    Returns a string, which can be used as a directory name.

    The default separator is '_'.

    Each run of spaces in the string is replaced by this separator.

Algorithm
    1: Each high ASCII character is replaced by its normal equivalent
    2: The string is converted to lower case
    3: Any HTML (including HTML entities) in the string is removed
    4: Any characters which are not (Perl) words, spaces or hyphens, are
    removed
    5: Runs of spaces are converted to the separator character
        For more details about this character, see the discussion of the
        dirify() method (above).

Melody 'v' Movable Type
    See http://openmelody.org for details.

Backwards Compatibility with Movable Type
    Unfortunately, Movable Type's usage of dirify() allows a fake separator
    - '1' - to be used for the second parameter in the call to dirify().

    The '1' triggered usage of '_' as the separator, rather than the '1'
    provided.

    This 'feature' has been preserved in "String::Dirify", but is
    discouraged. Instead, simply drop the second parameter and let the code
    default to '_'.

Distributions
    This module is available as a Unix-style distro (*.tgz).

    See http://savage.net.au/Perl-modules.html for details.

Authors
    "String::Dirify" started out as part of Movable Type's code.

    Then, Mark Stosberg cut down the original code to provide just the
    English/ISO/ASCII features.

    Lastly, the code was cleaned up, tests added, and all packaged, by Ron
    Savage *<[email protected]>* in 2009.

    Home page: http://savage.net.au/index.html

string-dirify's People

Contributors

ronsavage avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.