----- Original Message -----
From: "Laura Meli" <[EMAIL PROTECTED]>
To: "Perl-Win32-Users" <[EMAIL PROTECTED]>
Sent: Monday, November 11, 2002 07:41
Subject: Newbie Question


> Hi everyone,
>
> I am just starting out to use perl to write my test scripts.  I was
> wondering if there was a way to call one perl program from another.  I
know
> that if I have a .pm module then I call it by the use function.  How about
a
> .pl file?  I want be able to choose which tests I run each time I execute
my
> perl script.  My plan was to create a separate perl script for each test
> suite then have one main perl script which calls the scripts I want to
> execute.
>
> Thanks in advance for your help.  The emails I receive from this group
have
> been really helpful.


Laura,

There are many ways dpending upon your requirements. You might check out the
following:

do
eval
system

system in particular might be your best choice. There are certain times when
I want to execute scripts in a separate command window from the calling
script, like this snippet:

use Win32::Process;
$Params = join('','perl -w Doc1BillSelect.pl ',$Dir,$ARGV[0],'.dat
',$TempSvd,' ',$ARGV[1],' 4 \"',join(' ',@Args),'\"');

# Execute the selection program.
Win32::Process::Create($Process,'C:/Perl/Bin/perl.exe',$Params,0,CREATE_NEW_
CONSOLE,'c:/perl/scripts') || die ErrorReport();
$Process->Wait(INFINITE);

sub ErrorReport() {print(Win32::FormatMessage(Win32::GetLastError()));
return(1)}

Dirk Bremer - Systems Programmer II - ESS/AMS  - NISC St. Peters
636-922-9158 ext. 8652 fax 636-447-4471

[EMAIL PROTECTED]
www.nisc.cc


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to