Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: Re: Confused about splitting program into multiple files.

by disciple (Pilgrim)
on Feb 15, 2004 at 02:34 UTC ( #329082=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Confused about splitting program into multiple files.
in thread Confused about splitting program into multiple files.

You are correct that in this instance I have spent more time here trying to find if there is a preferred way to do what I want to do. However, this is something I will be and have been doing on a semi-regular basis.

It is a maintenance issue as well. Everytime you add a function, you must add it to the export line. I don't want to do that but if there is no other preferred means of using functions from another file, then I will.

Besides, can you really blame me for asking if there is a quicker/easier way? Aren't we all looking to make our programming lives a bit easier?

  • Comment on Re: Re: Re: Re: Confused about splitting program into multiple files.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Confused about splitting program into multiple files.
by chromatic (Archbishop) on Feb 15, 2004 at 06:59 UTC
    Aren't we all looking to make our programming lives a bit easier?

    In my experience, it is easier in the long run not to export everything into main::. Objects aren't perfect, but they tend to organize things.

    For small programs, it likely doesn't matter. Once I get over twenty or thirty functions, though, it really starts to matter very quickly.

Re: ^5: Confused about splitting program into multiple files.
by rchiav (Deacon) on Feb 15, 2004 at 17:10 UTC
    No, I don't blame you for asking. And yes, we're all looking for a quicker, easier way to do things. But I think the one thing you're missing here is that Perl and the use of modules, by design, does not export functions and variables. You say this is a maintenance issue. Having all those functions in main:: is also a maintenance issue.

    You mention that you work with C# and .NET. The recomendation there is to also use full namespaces when refrencing properties, methods and objects. As you'll notice, Visual Studio .NET generates full namespace paths. The difference is that .NET makes it easier to not do so.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2021-09-21 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?