Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Template to create modules

by choroba (Cardinal)
on Jun 14, 2016 at 15:45 UTC ( [id://1165606]=note: print w/replies, xml ) Need Help??


in reply to Template to create modules

It depends on what you want to do with the module. diagnostics is for newbies only, it probably shouldn't stay in the module once published. Carp is nice, but not always desirable, so add it only if needed.

The second template misses strict and warnings, and its way of using Exporter is clunky. I'd use something like the following instead:

use Exporter qw{ import }; our @EXPORT_OK = qw( blah ... );

Also note that the module doesn't need Exporter if it's object oriented.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1165606]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-19 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found