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.
And now.... method chaining!
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
Argument : the text to append.
m_prepend
Usage : $proto->m_prepend('some text to PREpend');
Purpose : Prepend text to $proto->string
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.
AUTHOR
Terrence M. Brannon
CPAN ID: TBONE
metaperl.org computation
tbone@cpan.org
http://www.metaperl.org
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.