Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Data Structure Question

by hok_si_la (Curate)
on Jan 31, 2005 at 17:02 UTC ( [id://426654]=perlquestion: print w/replies, xml ) Need Help??

hok_si_la has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks,

I am a C coder that has recently been thrown into a Perl crash course. I am coding a app of about 50 or so scripts that handle various network related tasks for the company I work for. Most require anywhere from 1 to 4 other scripts. The four scripts required are entirely unrelated.

#1-Automatically creates the web page and populates the iframe within it. It is also responsible for creating all the necessary icons for that utility.
#2-Returns a username by looking up a users id in ADODB
#3-A catch all SQL query function that uses DBI
#4-A tab function for page navigation

Now to the question. I would like to group all of these functions together so each script would essentially contain one 'use' for all four functions. I read that modules are typically used for related functions and routines so that is out of the question. Each of these four scripts will only be used in my suite.

How should I handle this?
I appreciate your advice, hok_si_la

Replies are listed 'Best First'.
Re: Data Structure Question
by dragonchild (Archbishop) on Jan 31, 2005 at 17:04 UTC
    Create four modules? Or, create one kitchen-sink kind of module. In other words, solve it like you would have in C, but use Perl instead of C as the solution language.

    Just because you've changed languages doesn't mean that everything you used to know is useless. In fact, 90% of your knowledge will be useful - you just have to figure out how to map it.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      Dragonchild,

      Thanks for your assistance. I had actually began creating a "kitchen sink" module for it but bailed out mid way through when I ran into confusion handling the module object within the invoking script. I will continue hacking away.

      hok_si_la
        You know that objects and modules are not synonymous. You create an object by using modules, but modules can and do exist outside of objects. Take a look at the source for List::Util for more information as to how you can make this work.

        Being right, does not endow the right to be rude; politeness costs nothing.
        Being unknowing, is not the same as being stupid.
        Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
        Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-19 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found