1String::Dirify(3)     User Contributed Perl Documentation    String::Dirify(3)
2
3
4

NAME

6       String::Dirify - Convert a string into a directory name
7

Synopsis

9               use String::Dirify;
10
11               my($dir_1) = String::Dirify -> dirify('frobnitz');
12
13       Or:
14
15               use String::Dirify ':all';
16
17               my($dir_2) = dirify('bar baz');
18
19       Or even:
20
21               use String::Dirify;
22
23               my($sd)    = String::Dirify -> new();
24               my($dir_3) = $sd -> dirify('!Q@W#E$R%T^Y');
25

Description

27       "String::Dirify" is a pure Perl module.
28
29       This module allows you to convert a string (possibly containing high
30       ASCII characters, and even HTML) into another, lower-cased, string
31       which can be used as a directory name.
32
33       For usage, see the Synopsis.
34
35       This code is derived from similar code in Movable Type.
36

Method: dirify($string [, $separator])

38       Returns a string, which can be used as a directory name.
39
40       The default separator is '_'.
41
42       Each run of spaces in the string is replaced by this separator.
43

Algorithm

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

Melody 'v' Movable Type

55       See http://openmelody.org for details.
56

Backwards Compatibility with Movable Type

58       Unfortunately, the way Movable Type uses dirify() allows a fake
59       separator - '1' - to be used for the second parameter in the call to
60       dirify().
61
62       The '1' triggered usage of '_' as the separator, rather than the '1'
63       provided.
64
65       This 'feature' has been preserved in "String::Dirify", but is
66       discouraged. Instead, simply drop the second parameter and let the code
67       default to '_'.
68

Distributions

70       This module is available as a Unix-style distro (*.tgz).
71
72       See http://savage.net.au/Perl-modules.html for details.
73

REPOSITORY

75       <https://github.com/ronsavage/String-Dirify>
76

Authors

78       "String::Dirify" started out as part of the Movable Type code.
79
80       Then, Mark Stosberg cut down the original code to provide just the
81       English/ISO/ASCII features.
82
83       Lastly, the code was cleaned up, tests added, and all packaged, by Ron
84       Savage <ron@savage.net.au> in 2009.
85
86       Homepage: http://savage.net.au/index.html
87
89       Copyright (c) 2009, Mark Stosberg, Ron Savage.
90
91       Copyright (c) 2010, 2011, Ron Savage.
92
93
94
95perl v5.36.0                      2022-07-22                 String::Dirify(3)
Impressum