.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "String::Dirify 3pm" .TH String::Dirify 3pm "2016-07-21" "perl v5.22.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" String::Dirify \- Convert a string into a directory name .SH "Synopsis" .IX Header "Synopsis" .Vb 1 \& use String::Dirify; \& \& my($dir_1) = String::Dirify \-> dirify(\*(Aqfrobnitz\*(Aq); .Ve .PP Or: .PP .Vb 1 \& use String::Dirify \*(Aq:all\*(Aq; \& \& my($dir_2) = dirify(\*(Aqbar baz\*(Aq); .Ve .PP Or even: .PP .Vb 1 \& use String::Dirify; \& \& my($sd) = String::Dirify \-> new(); \& my($dir_3) = $sd \-> dirify(\*(Aq!Q@W#E$R%T^Y\*(Aq); .Ve .SH "Description" .IX Header "Description" \&\f(CW\*(C`String::Dirify\*(C'\fR is a pure Perl module. .PP This module allows you to convert a string (possibly containing high \s-1ASCII\s0 characters, and even \s-1HTML\s0) into another, lower-cased, string which can be used as a directory name. .PP For usage, see the Synopsis. .PP This code is derived from similar code in Movable Type. .ie n .SH "Method: dirify($string [, $separator])" .el .SH "Method: dirify($string [, \f(CW$separator\fP])" .IX Header "Method: dirify($string [, $separator])" Returns a string, which can be used as a directory name. .PP The default separator is '_'. .PP Each run of spaces in the string is replaced by this separator. .SH "Algorithm" .IX Header "Algorithm" .IP "1: Each high \s-1ASCII\s0 character is replaced by its normal equivalent" 4 .IX Item "1: Each high ASCII character is replaced by its normal equivalent" .PD 0 .IP "2: The string is converted to lower case" 4 .IX Item "2: The string is converted to lower case" .IP "3: Any \s-1HTML \s0(including \s-1HTML\s0 entities) in the string is removed" 4 .IX Item "3: Any HTML (including HTML entities) in the string is removed" .IP "4: Any characters which are not (Perl) words, spaces or hyphens, are removed" 4 .IX Item "4: Any characters which are not (Perl) words, spaces or hyphens, are removed" .IP "5: Runs of spaces are converted to the separator character" 4 .IX Item "5: Runs of spaces are converted to the separator character" .PD For more details about this character, see the discussion of the \fIdirify()\fR method (above). .SH "Melody 'v' Movable Type" .IX Header "Melody 'v' Movable Type" See http://openmelody.org for details. .SH "Backwards Compatibility with Movable Type" .IX Header "Backwards Compatibility with Movable Type" Unfortunately, the way Movable Type uses \fIdirify()\fR allows a fake separator \- '1' \- to be used for the second parameter in the call to \fIdirify()\fR. .PP The '1' triggered usage of '_' as the separator, rather than the '1' provided. .PP This 'feature' has been preserved in \f(CW\*(C`String::Dirify\*(C'\fR, but is discouraged. Instead, simply drop the second parameter and let the code default to '_'. .SH "Distributions" .IX Header "Distributions" This module is available as a Unix-style distro (*.tgz). .PP See http://savage.net.au/Perl\-modules.html for details. .SH "REPOSITORY" .IX Header "REPOSITORY" .SH "Authors" .IX Header "Authors" \&\f(CW\*(C`String::Dirify\*(C'\fR started out as part of the Movable Type code. .PP Then, Mark Stosberg cut down the original code to provide just the English/ISO/ASCII features. .PP Lastly, the code was cleaned up, tests added, and all packaged, by Ron Savage \fI\fR in 2009. .PP Homepage: http://savage.net.au/index.html .SH "Copyright" .IX Header "Copyright" Copyright (c) 2009, Mark Stosberg, Ron Savage. .PP Copyright (c) 2010, 2011, Ron Savage.