Hi Alfred,
Base on your answer, I added my idea and changed the
script as:

$name1_perl="MaryGibson";

open IT, ">t3.bat";
print IT "\@echo off\n";
print IT "set name1_dos=$name1_perl\n";
print IT "\@echo name1_dos=%name1_dos%\n";
close IT;
system ( "t3.bat" );

The contain of $name1_per1 ,MaryGibson, is transfer to
DOS shell as contain of name1_dos.  Thank you very
much.  

Vice versa, I will @echo %name1_dos% > t4.txt in batch
file, then use perl script filehandler to read t4.txt
and assign to $name1_perl.  If you have better way,
please let me know.  Thanks again

--- Alfred Wheeler <[EMAIL PROTECTED]>
wrote:
> I'm not sure this answers your question... However -
> 
> #!perl
> open IT, ">mybat.bat";
> print IT "\@echo off\n";
> print IT "echo Hello World!\n";
> close IT;
> system ( "mybat.bat" );
> 
> ----- Original Message ----- 
> From: "Jason-Yahoo" <[EMAIL PROTECTED]>
> To: "A. Rivera" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Friday, November 09, 2001 4:37 PM
> Subject: Re: How to run DOS batch files or DOS
> commands in the Perl script
> 
> 
> > Thank you very much.  I tested successfully.  One
> more
> > question that how can I transfer the variables of
> in
> > Perl Script to DOS batch or vice versa (e.g.
> > "$name1_perl=..." in Perl; "set name1_dos=..." in
> DOS
> > Batch)
> > 
> > --- "A. Rivera" <[EMAIL PROTECTED]> wrote:
> > > system("batchfile.bat");
> > > 
> > > ----- Original Message ----- 
> > > From: "Jason-Yahoo" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Friday, November 09, 2001 4:09 PM
> > > Subject: How to run DOS batch files or DOS
> commands
> > > in the Perl script
> > > 
> > > 
> > > > I can run perl script in the DOS batch file
> e.g.
> > > > 
> > > > ....
> > > > @echo Next line will run Perl Script
> > > > perl perl_sample1.pl
> > > > ....
> > > > ....
> > > > 
> > > > But, how can I run DOS batch files or commands
> and
> > > > executable file in the Perl script.  Please
> give
> > > me example.
> > > > 
> > > >
> __________________________________________________
> > > > Do You Yahoo!?
> > > > Find a job, post your resume.
> > > > http://careers.yahoo.com
> > > > 
> > > > -- 
> > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > > 
> > > > 
> > > 
> > > 
> > > -- 
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Find a job, post your resume.
> > http://careers.yahoo.com
> > 
> > -- 
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> 
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

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

Reply via email to