Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

A quick scan of your module and I'm very impressed! Fantastic start for a Perl beginner! Just a couple of minor points I noticed after a quick scan of your code:

sub data_get(+$;$) {

Unless things have changed recently with the introduction of new Perl signatures, the traditional Perl code style advice has always been an emphatic "Don't use prototypes" -- see, for example, item 122 "Don't use subroutine prototypes" at Perl Best Practices. Googling just now turned up this this article by brian d foy on the newer experimental subroutine signatures (which I have no experience with).

This line of code from your module:

our $VERSION = '1.0.0';

is definitely wrong. It should read:

our $VERSION = '1.00';
This is one item that PBP unfortunately got wrong as mentioned here. See also Writing Solid CPAN Modules for general advice on writing CPAN modules.

Update: As noted by haukex here: our $VERSION = "1.23"; seems to be the most compatible with the various Perl tools that parse code to find information on modules.

I maintain a long list of general references on code standards and style advice at: Re: I need perl coding standards (Coding Standards References)


In reply to Re: Code style question by eyepopslikeamosquito
in thread Code style question by AlexP

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found