Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: How's My Style Now?

by duelafn (Parson)
on Feb 06, 2010 at 15:16 UTC ( [id://821749]=note: print w/replies, xml ) Need Help??


in reply to Re: How's My Style Now?
in thread How's My Style Now?

I second the module suggestion and sdd a couple of things to jethro's comments.

When you do create modules, do not use lower-case module names. Lower-case names are (by convention) reserved for pragmatic modules (in effect compiler directives). Additionally, placing your modules into a provate namespace can protect against name collision. For instance, you could use your initials so that require './library/main.pl'; becomes use RJTD::Main; (See also: perlmodstyle, perlnewmod, perlmod)

I also find the # center.pl comments a bit jarring, though my recommended alternative would be to document their origin at the beginning of the file like so1:

use RJTD::Main qw/ get_script_variables panel_start panel_end footer / +; use RJTD::Center qw/ get_general_text page_heading /; #... later get_general_text('musing_cat',1);

This way, you do not need to document each use of the function since you know that the list of imported functions is always at the top of the file.

1 When creating your modules use @EXPORT_OK rather than @EXPORT; See Exporter.

Update: Split EXPORT vs EXPORT_OK into footnote so that things makes sense.

Good Day,
    Dean

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found