On Fri, 2004-07-09 at 11:14, sudhindra k s wrote:
>
> Hi
>
> I have two scripts abc.pl and xyz.pl. Now abc.pl uses xyz.pl. i have implemented
> this as below.
>
> abc.pl
> {
> ....
> ....
> system("perl xyz.pl arg1 arg2");
> ...
> }
>
> Now both abc.pl and xyz.pl are in the same directory c:\test\script. But now i want
> abc.pl in some different directory, but xyz.pl remains in c:\test\script. And the
> location of abc.pl need not be fixed. So how do i implement this requirement?
you can do
my $dir = "c:\\test\\script";
system("perl $dir\\xyz.pl arg1 arg2");
If in case inside xyz.pl you are accessing some other files , just make
sure you give the full path.
but consider using do() instead of system(). Because when you use
system() you create a new instance of perl in the memory which is
totally unnecessary.
Thanks
Ram
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>