I have a question on module structure and usage::
I have 2 different .pl files they both use .PM's I have put in a subdir. Inside the .pl I have put the complete list of "use" statements for all PM's available.
Now I noticed that in both .pl's the same if-then loop exists. This is not a sub.
So... is there a way to just include exactly the same code on that particular spot in the .pl file OR should i write a new sub, define input parameters and output parameters (which were previously the variables in scope of the .pl) and how do then deal with the included .PM's ? Should I include all PM's again in this new PM?
--
I have 2 different .pl files they both use .PM's I have put in a subdir. Inside the .pl I have put the complete list of "use" statements for all PM's available.
Now I noticed that in both .pl's the same if-then loop exists. This is not a sub.
So... is there a way to just include exactly the same code on that particular spot in the .pl file OR should i write a new sub, define input parameters and output parameters (which were previously the variables in scope of the .pl) and how do then deal with the included .PM's ? Should I include all PM's again in this new PM?
--