Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Code style advice: where to put "use" statements?

by Argel (Prior)
on Feb 27, 2008 at 23:15 UTC ( #670781=note: print w/replies, xml ) Need Help??


in reply to Code style advice: where to put "use" statements?

I have a feeling that the reason it is not covered in PBP or elsewhere is it's taken for granted that they should be up at the top.

As for putting it inside of a sub to indicate it is only used by that sub -- that could be confusing to less experienced Perl programmers and might cause it to get missed if someone is eyeballing the script for dependancies. It would be better to put it at the top and add a comment explaining where it is used.

  • Comment on Re: Code style advice: where to put "use" statements?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://670781]
help
Chatterbox?
talexb wonders about dividing developers in those born before the Unix timestamp of zero .. and after. Spoiler: I'm before.
chacham remebers I am a mad scientist
[stevieb]: talexb I'm after by a few years, but we can still be friends because you live in my hometown ;)
[LanX]: White House
[LanX]: next inauguration ?

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-08-18 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (303 votes). Check out past polls.

    Notices?