|
MiscUtils - Miscellanous Utitlies. Provided in hopes that you will add your own functions. |
MiscUtils - Miscellanous Utitlies. Provided in hopes that you will add your own functions.
use MiscUtils;
print rindent(4).'I am 4 tabs over!';
mkdirs('/xtra/shared/mp3s/by/author/m/mo/mono/life_in_mono.mp3');
# hypothetical - see discussion below
this_useful_function_I_wrote_and_use_constantly ('I added it in myself');
MiscUtils is a collection of utility functions I found myself using in alot of my scripts. Then I thought it would be better to just throw them all into one huge unrelated, incoherant module. Then I thought it would be good to share with the world. Then I thought the world would benifit even more if they threw in thier own functions they constantly use.
This module is mostly provided as a means of making quick hacks quicker. For a serious or distributed script you should not rely on or require anyone to have this module. To get the functions out of this module into your serious or distributed scripts, just cut and paste directly into your script or module(s). The module is nothing special, so don't be afraid to hack it up.
Returns x number of tabs.
Arguments
Returns: (string) argument number of tabs
Example: print rindent(4).'I am 4 tabs over!';
Prints onto a filehandle or stdout x number of tabs.
Arguments
Returns: nothing
Example: indent(4); print ``I am 4 tabs over!\n'';
Makes the directories specified in the path.
Arguments
Returns: 1 upon success, 0 upon failure.
Example: if (mkdirs('/xtra/shared/mp3s/by/author/m/mo/mono/life_in_mono.mp3')) { # /xtra/shared/mp3s/by/author/m/mo/mono/ will definitaly exist. }
Simplify relative path, path blending.
Arguments
Returns: The new path.
Example: print swap_dirs('/publicwww/oldsite/index.php', '/publicwww/', 'http://lackluster.tzo.com:1024/'); # prints http://lackluster.tzo.com:1024/oldsite/index.php
Debug (pretty print) array ref, hash ref, or scalar. Not as cool as the Data::Dumper manpage
Arguments
Returns: nothing
Example: my @words = qw(a ab abc abcd); debug (\@words, 'my words');
Transforms non-XML-data elements to useful stoarge.
Arguments
Returns: Transformed Text.
Example: print $some_var_with_smart_quotes_and_punctuation;
Uh.... are you sure they aren't yours? Let me know if you find any.
BPrudent (Brandon Prudent)
email: xlacklusterx@hotmail.com
|
MiscUtils - Miscellanous Utitlies. Provided in hopes that you will add your own functions. |