Issue in executing more than one perl script from Single perl script

Issue in executing more than one perl script from Single perl script

am 01.11.2007 07:52:20 von nilesh.sonawane

Hi,
I am calling "1.pl" from "main.pl" file.
using
#main.pl
system ("perl 1.pl");

In this case it works fine.

But when I am doing
#main.pl
system ("perl 1.pl");
system ("perl 2.pl");

then it doesn't executes "1.pl" properly.
So I would like to know, is there any constraint for this? Do I need
to take any precautions for this?

Thanks,

Re: Issue in executing more than one perl script from Single perl script

am 01.11.2007 12:01:02 von Tad McClellan

nilesh.sonawane@gmail.com wrote:

> But when I am doing
> #main.pl
> system ("perl 1.pl");
> system ("perl 2.pl");
>
> then it doesn't executes "1.pl" properly.


You need to provide some symptoms if you hope for a diagnosis.

How do you know that it did not execute properly?

What did you observe?

Were any messages issued?

....


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"

Re: Issue in executing more than one perl script from Single perl script

am 01.11.2007 12:46:47 von Jim.Lane

On Nov 1, 2:52 am, nilesh.sonaw...@gmail.com wrote:
> Hi,
> I am calling "1.pl" from "main.pl" file.
> using
> #main.pl
> system ("perl 1.pl");
>
> In this case it works fine.
>
> But when I am doing
> #main.pl
> system ("perl 1.pl");
> system ("perl 2.pl");
>
> then it doesn't executes "1.pl" properly.
> So I would like to know, is there any constraint for this? Do I need
> to take any precautions for this?
>
> Thanks,

Why are you using system() for this? AFAIK it forks a
whole new process - a lot of overhead to go to.
Isn't this what the "require" facility is for?

FWIW

Jim Lane

Re: Issue in executing more than one perl script from Single perl script

am 01.11.2007 13:47:24 von Sherm Pendley

nilesh.sonawane@gmail.com writes:

> Hi,
> I am calling "1.pl" from "main.pl" file.
> using
> #main.pl
> system ("perl 1.pl");
>
> In this case it works fine.
>
> But when I am doing
> #main.pl
> system ("perl 1.pl");
> system ("perl 2.pl");

There's nothing wrong with the above code.

> then it doesn't executes "1.pl" properly.

What kind of output were you expecting, and what did you get instead? You
need to offer a better description of the problem than "it doesn't work",
if you expect more than just random guesswork in response.



> So I would like to know, is there any constraint for this? Do I need
> to take any precautions for this?

"This" being what, exactly? Perl has no problem calling system() twice; to
be blunt, it's patently absurd to think it might have such a restrictive
problem.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: Issue in executing more than one perl script from Single perlscript

am 01.11.2007 19:19:30 von Josef Moellers

Jim.Lane@cibc.com wrote:
> On Nov 1, 2:52 am, nilesh.sonaw...@gmail.com wrote:
>> Hi,
>> I am calling "1.pl" from "main.pl" file.
>> using
>> #main.pl
>> system ("perl 1.pl");
>>
>> In this case it works fine.
>>
>> But when I am doing
>> #main.pl
>> system ("perl 1.pl");
>> system ("perl 2.pl");
>>
>> then it doesn't executes "1.pl" properly.
>> So I would like to know, is there any constraint for this? Do I need
>> to take any precautions for this?
>>
>> Thanks,
>
> Why are you using system() for this? AFAIK it forks a
> whole new process - a lot of overhead to go to.
> Isn't this what the "require" facility is for?

Using system, you start a completely new program which executes on its
own, in its own context and e.g. is not required to be a Perl program at
all.

OTOH "require" will include the Perl program code into the current
program code.

--
Mails please to josef dot moellers
and I'm on gmx dot de.