Welcome to the Monastery | |
PerlMonks |
Re: converting libraries into modulesby dragonchild (Archbishop) |
on Mar 05, 2006 at 02:30 UTC ( [id://534550]=note: print w/replies, xml ) | Need Help?? |
In Perl5, libraries and classes are implemented using the same mechanism (packages, usually in their own .pm files), but they're completely different. If you're converting P4-style libraries to P5-style, all you need to do is follow this template.
Old:
New:
Now, when you use them, you'll do it like this: Old way:
New way:
Now, the different between @EXPORT and @EXPORT_OK is how you construct the 'use' line. Here's a few examples:
My criteria for good software:
In Section
Seekers of Perl Wisdom
|
|