To module or not to module that is the question

Howdy List,=20

Bit of a quandry here.

I have a script that does everything it's supposed to.

It's basically like this:
Configuration variables here:

Program flow here with a single print statement after=20
it figures out what it's doing based on the configuration and user =
Now I need to use this same script lots of times so I already have =
differen configurations saved as different modules then in the script =
all I have to do is:
In One.cgi:
 use Special::One;
# this brings in all the configuartion stuff for 'One'

Rest of script here that uses the variables set up in the module above
In Two.cgi:
 use Special::Two;
# this brings in all the configuartion stuff for 'Two'

Rest of script here that uses the variables set up in the module above
What I'd like to do is this:

 use Special::Blah; # set the configuration
 use Special; # imports one function, doscript(),which is basically the =
"rest of the script"
 print doscript();

Where doscript() basically contains the "rest of the script" mentioned =
above and replaces=20
the print with return at the end.

That way I can do all the configs I want and if I change the script I =
only have to change it in one place instead of every script.

So my question for all you experienced module folks is this:

1) If I do it that way is there anythign special I need to do to get the =

variables and things imported by=20
use Special::Blah; able to be used in the routine doscript(); ??

Does that make sense?

2) Am I thinking correctly about how doscript() would work?
	before in script:=20
	if($this =3D~ m/$that/) { ....
	elsif($the =3D~ m/$other/) { ...
	else { ...
	print $results;

	after in script:
		use Special; # imports doscript();

	package Special;
	sub doscript {
		if($this =3D~ m/$that/) { $results =3D mysubhere(); }
		elsif($the =3D~ m/$other/) { ...
		else { ...

		sub mysubhere {....}=09

		return $results;

3) Am I just crazy?



7/22/2003 5:16:42 PM
perl.beginners 29388 articles. 4 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 19


Similar Artilces:

modules, modules
This site appears to be the most comprehensive list of free custom modules: Any other sites? I do like how Rainbow gives you a bucket of them - saves a lot of time over having to snoop around and find some of the DNN ones. Is there also a way to list modules as "certified"? Also - is there a decent repository of skins? I have recently installed version 2.0. Sure wish there were more modules ready for it! That would make it much easier to evaluate the program and give recommendations to my boss. The reason there aren't more 2.0 modules yet is becasue it h...

Module in Module
Hi, Is there a way to place a module inside another module (e.g. A feedback module inside a Text/HTML module) ? Cheers Tassos There is a way to inject controls into a module dynamically based on some criteria like a querystring parameter - is that what you are wanting to do?Dylan Barberread my stupid blog There's a commercial module "wrapper" on Snowcovered that is designed to hold other modules.  So it is possible.I don't know if you could put a module holding a module inside a module containing a module, but I wouldn't try.  The entire space-time...

To Data Module or not Data Module, that is the question
Can anyone offer best practice advice please. Porting my access application to Delphi I have used a data module. It now has one Tdataconnection and lots and lots of TDAOQueries and TDAOTables on it. Its now getting hard to see the wood for the trees. My question is twofold. 1) is is best to use a data module or just use the TDOQueries I need on each form? 2) is it best to use loads of TDAQueries, each with hard coded SQL or use just one or two with the sql string dynamically loaded just before I execute it. With Qn 2 it is starting to look bettert to dynamically load the sql from a f...

A Module inside a Module ??
Hi DNN Community, I've developed a DNN module (let's call it module X) which is included in my DNN website as a private assembly. However, I'l like to add a scrolling marque usercontrol to my module X. As a start, I purchased a scrolling marquee module from snowcovered which works great as a stand alone module. However, I'd like to modify this module so it fits into my module X. Can anyone explain to me how to do this, and if there is any source code available where I could see how this is done. Thanks in advance, Brad How about putting a placeholder control in your module X then...

Load module into module...
Is it possible to load a module into another module? I'm thinking in particular of the Internal Links Module available @ I use this module a lot and with a few enhancements it has served me well, however it has one flaw...each link only allows html data...because it is just a holder that loads the html from the db. It would be a great enhancement to be able to add other modules to these links i.e. announcements, news, pictures etc but they would in effect have to be loaded into another module. Any thoughts would be appreciated on how I should approach this or whether it...

Modules and information about modules.
As we live in a word with different localization issues I think it would bee nice to tell byers and user if the module can handle different cultures and of cource if the module are localized or not. Sometimes it doesent matter that the module have static localization you can use it anyway. But if the date format or any other localized value are used inside the module I think it is essential to tell too. As an example I can tell that Portal Store just works if you use the US date format. So if you like to use it in non us english you have to go through the code and correct it. As I know th...

How to load modules into modules
Title says it all. I want to load (custom) modules within a custom module. But I havent the slightest idea how to do that. Any suggestions? thx Like this: Dim _MyControl as _MyControl _MyControl = CType(Me.LoadControl("MyControl .ascx"), MyControl) ParentControl.Controls.Add(_MyControl) Leigh PointerUser Group Champion » Evangelising DotNetNuke Everywhere « The method LoadControl works, if your loaded custom module doesn't need do raise PostbackEvents :-( If you need that... Than this way is impossible for you. I will post how to do it right in...

Module to Module Communication
Does anyone have an example of how to implement module-module communication/event handling using DNN2? I have tried to look through the portal code and try to figure it out for myself but not much luck :) Tom Gruszowskiemail: [MyUserName] To answer my own question I found the following link. Any other resources and solid examples that anyone else would like to share? Gruszowskiemail: [MyUserName] I seem to remember an example on kodhedz.netMatt FraserDotNetNuke Co...

sub modules, loading custom modules into a parent module
GreetingsI am creating a support system module which will require the ability to add sub modules. For example, there is an admininstrators section in which suport requests are administered, anwsered, solved etc.There is to be another function in the admin section of the support module in which admins can upload a new support form template module, ie, say an admin wants to set up a form for users to lodge a request for new hardware, the form will display all required fields, graphics, validation etc for that request. Another support form template might be to have a new user set up on the acti...

Modules within Modules
I purchaced the Internal Link Navigation from Snowcovered a while back and have modified it so I can insert user controls in the child-level pages. However, if I try to insert a IBS module, it returns an error because the IBS modules use desktopcontols.vb to pull properties for the module from the database and I haven't set that up properly. When I look at the code in tablayout.aspx.vb I have a hard time sorting through it. Any ideas? Do you want to post your mods to Internal Link Navigation - I have done a fair bit of work with that so may be able to help Or email the code to me Dav...

Module questions (perhaps a module creation mini-tutorial)
Hello list, I am trying to make my own modules for some tasks, and I am trying to grasp the basics before I go any further. Here is a dumb test module that I wrote just to see how things are done - it takes an array of 3 values and adds them together, returning the values on request. ### 3-element-array-calc test module ( package CalcTest; use warnings; use strict; my @collect; 1; sub new { my $class = shift; my $self = {}; @collect = (0,0,0); bless $self, $class; return $self; } sub add { print (shift @_);...

Module within a Module
Anyone experiemented with IBS to create a module that could contain other IBS modules?Robbie Freeland Web Team Leader yeah - with limited sucess as things started to go screwey after a while with the containers - it is something I still want to get working - but I dont seem to have the time to do so at the momentVarious IBS Addons available at http://www.snowcovered.comLead Developer [vb & c#] - MCAD I have been able to do it, just displaying information in datagrids, but I had to pass variables in the URL to keep the nested module active and visible as the page re...

Modules Containing Modules
I have no idea if this is possible or not, but I'm keeping my fingers crossed. Basically, what I need is a module container that can hold other modules. The reason is because on some views within my portal site, I need to have multiple regions (i.e. links, static text/html). I'm sure I can create different modules for specific scenarios, but this happens A LOT, so I'm hoping there's already something doing it. I have yet to dig into building my first module, so it may not even be a big deal. Has anyone attempted this before? If so, are there any public tools already published that I'...

Can module name be something like: com::xyz::PakageOne? Because when I created a package with that convention, the package was created but there is no _st_ and _sk_ generated for me. Thanks. .... Steve ...

Web resources about - To module or not to module that is the question - perl.beginners

German question - Wikipedia, the free encyclopedia
"Kleindeutschland" redirects here. For the neighborhood in New York City, see Little Germany, Manhattan . 1820 map of Central Europe showing ...

South Africa: Questions Raised Over Former Minister's Signature On Nuclear Procurement Notice
As questions are raised by opposition parties over former energy minister Ben Martins' signature on the recently gazetted notice to move ahead ...

Question Of The Day: Greatest hood scoop ever?
Filed under: Automotive History Just about every manufacturer has installed some sort of scoop, functional or not, to at least one vehicle hood. ...

If you want to work for Airbnb, get ready to answer these 27 ridiculous interview questions
Airbnb is the third-most valuable private tech company in the world — it has a $25.5 billion valuation . If you want to work there, you might ...

Review: Ten Economic Questions for 2015
At the end of each year, I post Ten Economic Questions for the coming year. I followed up with a brief post on each question. The goal was to ...

Questions raised about San Bernardino shooter's visa
Chair of House Judiciary Committee says immigration officials had insufficient evidence to issue Tashfeen Malik a visa to enter the U.S.

“R. Kelly walked out of a HuffPo interview after some awkward questions” links
R. Kelly walked out of HuffPo interview after being asked some awkward questions about his fans’ reactions to his sexual assault of minors. [Dlisted] ...

Shocker: Hillary Clinton Spins Question On Bullying In Order To Criticize Donald Trump
Shocker: Hillary Clinton Spins Question On Bullying In Order To Criticize Donald Trump

A very important question: What are your Christmas food traditions?
Merry Christmas! I have an important question for you: What do you cook and/or eat on Christmas? Thanksgiving is easy. There’s a standard repertoire ...

David Foster Defends His Ex Yolanda Foster: Don't Question Her Lyme Disease
David Foster Defends His Ex Yolanda Foster: Don't Question Her Lyme Disease

Resources last updated: 12/26/2015 10:19:03 PM