Wiki PerlDoc

From Deep Thought

Jump to: navigation, search
PerlDoc
Enlarge
PerlDoc

PerlDoc is a MediaWiki extension.

Contents

About The Extension

Usage

Replace Postgres::Handler with the installed Perl module you wish to report on. Perl modules can be be found on CPAN and can be installed on your Linux box using the shell command:

cpan -i Postgres::Handler

PerlDoc

Examples

<perldoc>Postgres::Handler</perldoc>

Parameters

  • Between the brackets: enter the name of an installed perl module
  • format: any format supported by perldoc on your system
    • the default format is html

Like This

String::FormatX

NAME

   String::FormatX - Perl extension for formatting strings and numbers

Purpose

   Formats a string based on pre-defined String::FormatX templates or
   user-supplied template patterns.

Requires

   You will need all of the modules below to be installed for the
   String::FormatX library to work.
   Exporter
   Number::Format
       Carp

Synopsis

           # As a function library...
           use String::FormatX qw(FormatX);
           my $FormattedSSN = FormatX('123456789','999-99-9999');
           print $FormattedSSN; # prints 123-45-6789
           my $GreenMoney = FormatX('123456789','~PRICE');
           print $GreenMoney; # prints $ 1,234,567.89
           # As an object...
           use String::FormatX;
           my $StrObj = new String::FormatX;
           my $FormattedSSN = $StrObj->FormatX('123456789','999-99-9999');
           print $FormattedSSN; # prints 123-45-6789

Author

   Lance P. Cleveland Charleston Software Associates (www.CharlestonSW.com)
   (c) 2005-2006 - Charleston Software Associates, Inc.

Public Methods

   new()
        Create a new String::FormatX object.
        Properties
        ERRMSG - contains last error message generated during String::FormatX processing

   new()
        Create a new FormatX object.
   FormatX()
        Return a string formatted as instructed.
        Parameters
        STR            => Input string to be formatted
        FORMAT  =>     Format template
       The FORMAT Parameter
            FORMAT can be set to a predefined string as in FORMAT=>'~PRICE' or to a
            user-defined output string as in FORMAT=>'999-99-9999'.
            Predefined Strings
            ~PRICE - return a price starting with "$ ", comma separated, and 2 decimal precision
            User Defined Strings
            9 - only a numeric allowed in this position
            X - alphanumeric and '_' allowed in this position 
            All other characters are taken as literal replacements within the text.
            Processing
            When a '9' or 'X' appears in the format string the input string is processed
            scanning for the next numeric or alphanumeric throwing away all interim
            characters during the search.  In other words, if we are looking for digit format
            such as '999.99' and we get 'blah12blah345' you end up with '123.45' because
            we threw away the blah blah.



Download

http://www.cybersprocket.com/wiki/extensions/PerlDoc/PerlDoc.phps

Change Log

v0.1 released 2008-01-05

  • Initial version
  • PerlDoc with format support
Personal tools
Cyber Sprocket Labs
Cyber Sprocket Tech