Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

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

is long to read it carefully, so just some notes.

$attrs{'currency'} //= 'GBP'; defined or was intruduced in 5.10.0 so you need use 5.010; in your code and in your Makefile.PL or what you use instead of it. If you want to support older perl versions you need an alternative syntax like:  $attrs{'currency'} = $attrs{'currency'} ? $attrs{'currency'} : 'GBP' ;

my %attrs = @_; you put some type checking some line below. I like it splitted into another, dedicated sub: my %attrs = _check_args(@_); here you can excercise your fantasy at will. Wrong args can be common for a public used module.

Carp is another things I like a lot. Generally a misuse by a module consumer should point to code invoking and provoking the error, not to your module code at line ... Internal errors of your module should be highlighted more carefully, possibly pointing both to your and their code.

Searching for attrs in your code I noticed something strange: your methods get_intent get_intent_id get_ids all starts with my ($self, %attrs) = @_; I do not understand: only get_ids is called with arguments. Then (but I do not looked to it closer) why these attrs are not incapsulated inside the main object?

Internal usage of HTTP_HOST and the alike should be documented. I dont recall the whole thing, but document it. They are always used by every server? Only by some? (I'm not a web expert as you can see ;)

Finally I like your pod because it explains nicely what the matter is: this is a rare quality!

It appears you are using CGI as all your example use it: in 2021 one might expect some example at least in Dancer2

Then, but is my lack of understanding, I dont get why your module ends returning some html. I think you try to explain it in the pod but I dont get it :)

Do you plan to test your module against a live sandbox api? In author tests or during make test aka everytime someone install your module? This can be fun :)

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re: [RFC] Module code and POD for CPAN by Discipulus
in thread [RFC] Module code and POD for CPAN by Bod

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 rifling through the Monastery: (4)
As of 2024-04-20 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found