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

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

by rchiav (Deacon)
on Feb 15, 2004 at 02:14 UTC ( #329079=note: print w/replies, xml ) Need Help??


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

You're saying the reason you don't want to use a module is because you don't want to copy and paste 40 function names into the @EXPORT array? I'd think you spent more time here trying to find a different way than it would have taken to copy and paste those function names to begin with.
  • Comment on Re: Re: Re: Confused about splitting program into multiple files.

Replies are listed 'Best First'.
Re: Re: Re: Re: Confused about splitting program into multiple files.
by disciple (Pilgrim) on Feb 15, 2004 at 02:34 UTC

    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?

      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.

      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://329079]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2021-08-06 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (44 votes). Check out past polls.

    Notices?