Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: When do you include the usual use pragmas in your example code?

by hippo (Curate)
on Aug 03, 2013 at 13:55 UTC ( #1047707=note: print w/ replies, xml ) Need Help??


in reply to When do you include the usual use pragmas in your example code?

It's an interesting concern and should probably remain up to the whim of the individual poster, but I like your solution of shifting the boilerplate to your sig.

FWIW, I don't use say because the very, very small benefit it gives is far outweighed (for me) by the portability constraints. I think it would be fine to use it if the OP uses it or if the OP's code implies a recent enough version where it won't give an error.

I think it is always worth including strict and warnings in any sample code other than a one-liner. If every example of code a novice sees includes these pragmas then even the slowest student will eventually twig that having them in there must be considered A Good Thing. Doing so also has the added advantage that I expect to see it in my own code or third-party code on which I am working and any absence there will become even more noticeable as a result.

All just my opinions, of course.


Comment on Re: When do you include the usual use pragmas in your example code?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2014-11-26 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (171 votes), past polls