NAME
String::Mutate - extensible chaining of string modifiers
SYNOPSIS
use String::Mutate;
# Create base object with a string slot and some useful
# string modifiers.
my $proto = String::Mutate->proto;
$proto->string # "Hello, World"
# Hello, World. It's me Bob
$proto->m_append(". It's me Bob");
# Biff!Hello, World. It's me Bob
$proto->m_prepend("Biff!");
# Biff!--Hello, World. It's me Bob
$proto->m_insert("--", 4);
# Insert yuy at some_random_place into the string
$proto->m_rand_insert("yuy");
# Insert $number junk chars at some_random_place into the string
$proto->string('reset to clean string');
my $number=4;
$proto->m_chunk_of_junk($number); # res()`*et to clean string
DESCRIPTION
There comes a time in every data munger's career when he needs to muck up the data. This module is designed to make it easy to code up your own special wecial, tasty-wasty string mucker-uppers. It comes with the mucker-uppers you saw in the SYNOPSIS. But you are dealing with a Class::Prototyped object, so you can extend the beskimmers out of it if you so please.
USAGE
Well, the SYNOPSIS told all. But let's say what we just said again.
First you construct your prototype object:
my $proto = String::Mutate->proto;
Then you call any of the m_*
methods which will then mutate $proto-
string> and leave the results in same. So without further adieu, here are the pre-packaged string mutators
BUILT-IN STRING MUTATION METHODS
m_append
Usage : $proto->m_append('some text to append');
Purpose : Append text to $proto->string
Returns : nothing. this is OOP you know.
Argument : the text to append.
m_prepend
Usage : $proto->m_prepend('some text to PREpend');
Purpose : Prepend text to $proto->string
Returns : nothing. this is OOP you know.
Argument : the text to Prepend.
m_insert
Usage : $proto->m_insert('insertiontext', $after_what_char);
Purpose : put insertion text into string after a certain char
Returns : nothing. this is OOP you know.
Argument :
1 - the text to insert
2 - the 1-offset position to insert at
m_rand_insert
Usage : $proto->m_rand_insert('text');
Purpose : put insertion text into string at some random place
Returns : nothing. this is OOP you know.
Argument :
1- the text to insert at some random place in the string. When is someone
going to write something to automatically generate this assinine
butt-obvious documentation from my fresh, crispy clean with no
caffeine source code?! sounds like a good master's project for some
AI weenie.
m_chunk_of_junk
Usage : $proto->m_chunk_of_junk($chunk_size)
Purpose : put a string of junk chars of length $chunk_size into
string at some random place
Returns : nothing. this is OOP you know.
Argument : How long you want the chunk of junk to be. Actually it isnt
how long you *want* it to be. It is how long it will be whether
you want it that way or not. Computers are like that. Stubborn
lil suckers. Fast, useful, but not so obliging.
BUGS
There are rougly 3,562,803 bugs in this code and I am offering every woman on this earth a chance to sleep with me should you report one within the next 333,333,333 seconds... assuming there is still a Planet Earth around given what Mister You Know Who in the You Know What House is doing to "civilization" as we know/knew it. I wonder if kahnivoa picks up on such indirect innuendos to unohoo.
SUPPORT
Wait a minute, support?! I'm giving you this module for free and you have the nerve to read the support section??? What is this world coming too. Ok, ok if you have beachfront property in California or a tough-looking uncle named Rocko in Queens, NY I'm sure we can workk something out.
AUTHOR
Terrence M. Brannon
CPAN ID: TBONE
metaperl.com Computation
tbone@cpan.org
http://www.metaperl.com
COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
SEE ALSO
perl(1). ExtUtils::ModuleMaker by the one and only James Keenan. Without that, I would've had to type
h2xs -A -X -n String::Mutate
and that is an unthinkable inconvenience in this Modern Space Age of HiTekPerlDevelopment.