Rob, Thank you very much! I got it worked !
Dawn ----- Original Message ----- From: "Sisyphus" <[EMAIL PROTECTED]> To: "Dawn Sun" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, January 27, 2003 9:53 PM Subject: Re: newbie question: about perl56 and perl58 > > ----- Original Message ----- > From: "Dawn Sun" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, January 28, 2003 11:34 AM > Subject: newbie question: about perl56 and perl58 > > > I have both perl5.6 and perl5.8 installed on win2k. I want to find a way to > have a perl5.6 script(or subroutine) in a perl5.8 program. > something like: > >>>>> > #!c:\perl58\bin\perl.exe > ..... > test (); > sub test { > #!c:\perl56\bin\perl.exe > ...... > } > > >>>> > Is this possible? Or other solution to have the perl58 script run the perl56 > script? > > ------------------------------------------------- > > One solution would be to use backticks: > > sub test { > my $x = `c:\\perl56\\bin\\perl.exe your_script.pl`; > return $x; > } > > or, for a subroutine: > > sub test { > my $x = `c:\\perl56\\bin\\perl.exe -e "#your_code"`; > return $x; > } > > If the script/sub doesn't return anything that you're interested in then you > could use the system() command: > > sub test { > my $err = system("c:\\perl56\\bin\\perl.exe your_script.pl"); > if($err != 0) {die "The system call failed"} > } > > The shebang line doesn't help determine which perl.exe gets used. On Windows > that line is ignored except for any switches it contains (such as '-w'). > When you run 'perl some_script.pl', the perl.exe that runs 'some_script.pl' > is the first perl.exe that is found in the directories in your path. > > Cheers, > Rob > > > _______________________________________________ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ################################################################# ################################################################# ################################################################# ##### ##### ##### ################################################################# ################################################################# ################################################################# _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs