On Thursday, Mar 27, 2003, at 16:16 US/Pacific, Wiggins d'Anconia wrote:


Luinrandir Hernsen wrote:
How do I run another perl program from within another perl program?
if (x=0)
{
perl_ program_ 1.pl
}
else
{
perl_program_2
}
exit;

Surprised that neither of the other two (especially drieux) asked the question, "Why would you want to do such a thing?" ;-)...

the full on generic nature of the programme, which as you will note is psuedo code since (x=0) is not a valid statement in perl... so.... well, I was trying to be Nice... { he said sheepishly.... }

It would be best to refactor the reusable code into libraries that then get included and the code run directly, avoiding multiple instances of the perl interpreter needing to be run, etc....

now I R feeling old... 'refactor the reusable code into libraries'


I belived what the young whipper snapper[1] means to say is

        perldoc perlsub
        perldoc perlmod
        perldoc h2xs

or my canonical whine about it all at

http://www.wetware.com/drieux/CS/lang/Perl/PM/

Since the fun of the process is that one can build both
the 'supporting applications' as well as the CGI code
out of the common basic set of 'building blocks' - IF
of course you control the external perl code....

Depending upon how your development process is, you
can also start spinning 'site specific' perl modules
so that have much of the look and feel stuff off in
their own specialized modules - and a change in one
module will of course propogate to all of the actual
perl scripts that make up the CGI complex...

The ugly side of course is that this can lead to
my current angst filled moment:

I have this piece of perl CGI code where I abstracted
the 'problem' into a neat sub, but, well it is still
only One Sub, and it doesn't fit into any of the
current perl modules related to that project, and
I haven't quite found an excuse to make it a full
on stand alone module of it's own... But trust me
the moment that I can find some re-use cousins
that will make it a stand alone module, we
RIP that sub out, plonk it into the module, change
this piece of CGI to have the

use Foo::Bar::Baz qw/that_cool_sub/;

and it will be maintained along with its cousins.


ciao drieux

---

[1] kids these days, wasn't like that when I was
growing up we had respect for our elders,
The Doors, The Stones, The Band...


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to