Solstice::StringLibrary - A library of generic string manipulation functions
use StringLibrary qw(truncstr); my $str = truncstr("This is a line of text that needs truncating.");
Functions in this library make no assumptions about the content of the string being modified.
Exporter
No symbols exported.
Returns $string with all ê-like unicode entities packed into perl unicode.
$string
Returns $string with all malicious scripts, broken tags, relative links, dynamic css, etc removed.
Returns $string truncated to $cutoff, and appended with an optional cutoff marker (defaults to '...').
Returns $string truncated to $left_limit characters to the left of the first @ sign, $right_limit characters to the right of the last @ sign. It will use $marker as the replacement. Defaults are 20, 30 and '...'.
Returns a string of fixed-length. Strings shorter than $cutoff are ignored. Strings longer than $cutoff are transformed as in the following example: Before: This is a long string of text that needs shortening After: This is a long string o...ning
Returns a string with breaking spaces inserted.
Returns $string with HTML entities encoded. The string $unsafe_chars specifies which characters to consider unsafe (i.e., which to escape). The default set of characters to encode are control chars, high-bit chars, and the <, &, >, ' and " characters. This function just wraps HTML::Entities::encode_entities.
Returns $string with HTML entities decoded. This function just wraps HTML::Entities::decode.
Returns $string transformed into a non-HTML-renderable string, by converting '&<"' chars to entities. Numeric entities are ignored. If $convert_whitespace is passed and is true, whitespace chars ' ', \t and \n are converted to HTML approximations.
Removes double slashes in urls
$string should contain html. Returns $string with html removed, and replaced with whitespace formatting.
<ul> eg: <li>a becomes: * a <li>b * b </ul>
$string should contain html. Returns $string with html removed.
Returns $string transformed into a non-breaking HTML line by replacing ' ' with ' '.
Changes certain characters (curly quotes, emdash, endash) to their ASCII equivalent.
\x91 curly single quote left \x92 curly single quote right \x93 curly double quote left \x94 curly double quote right \x95 bullet point \x96 emdash \x97 endash \xa9 copyright \x85 elipses • bullet point
Returns $string transformed into a safe url, by url-encoding non-word characters.
Returns $string transformed into a safe file name, by converting spaces to underscores and removing forward slashes. $preserve_whitespace specifies that whitespace should be escaped rather than translated.
Returns $string transformed into a javascript-safe string, by escaping single- and double-quote characters.
Remove leading and trailing whitespace from $string.
This will return a string with ]]> escaped, so it will be cdata safe.
Exporter, HTML::Entities, HTML::TreeBuilder, HTML::FormatText, Solstice::StripScripts::Parser.
Catalyst Group, <catalyst@u.washington.edu>
$Revision: 2418 $
Copyright 1998-2007 Office of Learning Technologies, University of Washington
Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.opensource.org/licenses/ecl1.php
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '•'. Assuming UTF-8
To install Solstice, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Solstice
CPAN shell
perl -MCPAN -e shell install Solstice
For more information on module installation, please visit the detailed CPAN module installation guide.