Perl::Critic, by default, attempts to enforce the content of
Perl Best Practices.
PBP is intended as a set of guidelines and suggestions to make you think about how you write your code and whether it can be improved upon, not as a set of ironclad commandments.
Therefore, Perl::Critic's warnings should also not be taken as strict rules that you must comply with.
Perl::Critic gives you an explanation of why it objects to return undef;. Use that explanation to determine whether it is appropriate for you to return undef; in this case or not.
Also note that the Perl::Critic explanation says, "The solution is to just use a bare `return' statement whenever you want to return failure." If your intent is to return an undefined value rather than to indicate failure, then there's no problem with your return undef;, is there? (In that case, I would advise adding a comment stating that this is the intent so that a future maintainer who subscribes to PBP doesn't break your code in an attempt to "fix" it. Mentioning in the sub's documentation that a return value of undef is not intended to indicate failure would also be wise.)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.