Difference between revisions of "Creating a Perl Module"
From Organic Design wiki
m |
(example) |
||
Line 10: | Line 10: | ||
*Ensure easy upgradability (maybe by packaging into a debian package), see [[Creating a Debian package]] | *Ensure easy upgradability (maybe by packaging into a debian package), see [[Creating a Debian package]] | ||
− | [[ | + | == Example == |
+ | <perl> | ||
+ | $od = OrganicDesign::Wiki->new( | ||
+ | url => 'http://www.organicdesign.co.nz', | ||
+ | user => 'foo', | ||
+ | pass => 'bar' | ||
+ | ); | ||
+ | |||
+ | $od->edit( | ||
+ | title => 'MyArticle', | ||
+ | content => '[[foo]]', | ||
+ | summary => 'testing', | ||
+ | minor => 1 | ||
+ | ); | ||
+ | </perl> |
Revision as of 22:31, 23 June 2008
Creating a Perl Module Organic Design procedure |
We need to make a general package first which:
- Collects a bunch of functions we use into one includable module
- Makes the module installable as one of potentially many modules within OrganicDesign::
- Adds the installation of it into the Debian Post Install
- Ensure easy upgradability (maybe by packaging into a debian package), see Creating a Debian package
Example
<perl> $od = OrganicDesign::Wiki->new( url => 'http://www.organicdesign.co.nz', user => 'foo', pass => 'bar' );
$od->edit( title => 'MyArticle', content => 'foo', summary => 'testing', minor => 1 ); </perl>