Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

•Re: Source files, packages and name spaces

by merlyn (Sage)
on Apr 15, 2002 at 14:07 UTC ( #159196=note: print w/ replies, xml ) Need Help??


in reply to Source files, packages and name spaces

My standard idiom for including multiple packages in the same file is:

BEGIN { package My::Package; ... code goes here ... }
That way, it acts like a use, causing all "regional" definitions and actions to be executed before the "main" program starts running.

-- Randal L. Schwartz, Perl hacker


Comment on •Re: Source files, packages and name spaces
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (14)
As of 2015-07-28 18:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls