Thanks a million for the response.

I wanted to include the shell script, abc, as I want to access a variable.
The shell script, abc, actually takes a value (val) from the user.
I want to use that value (val) in my perl porgram. Is that possible?

ie., I will now call abc in my perl program using system
"/home/xxx/yyy/abc";
The script, abc, asks for a value, val, from the user. After its execution,
I want to use val in my perl program.

Can you suggest the procedure to use val in my Perl program?

Thanks & Regards,
Lakshmi
952-833-1220

-----Original Message-----
From: Adriano Ferreira [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 06, 2006 2:14 PM
To: [EMAIL PROTECTED]; beginners@perl.org
Subject: Re: ksh in a perl program


On 6/6/06, Lakshmi Sailaja <[EMAIL PROTECTED]> wrote:
> Can I include a korn shell script in a perl program?

Not include, but you certainly can execute a shell script from within
a Perl program.

> I have done the following but I get a compilation failed error.
> abc is the ksh script.
> -----------------------------------------------------
> require "/home/xxx/yyy/abc";

'require' is to load *Perl* modules - your script as you said is for
ksh. Even though Perl has a lot of the natural feeling of shell
scripts, it does not parse shell scripting language. Many scripts may
be translated to Perl with little additional work (possibly adding a
bunch of quotes and colons).

You may try something like

         system "/home/xxx/yyy/abc";



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to