Thanks David for your prompt reply.
I have done that, but I want to avoid using call.pl here, or atleaset would
like to avoid number of files.
It is for sure that, I should use file1.pl and file2.pl, because these two
files are working on different kind of data.

Hope I am clear here.


On 3/11/09, David M. Funk <[email protected]> wrote:
>
>  Mujju,
>
>
>
> Try using the require statement in call.pl
>
>
>
> Example call.pl
>
>
>
> C:\perl\bin\perl.exe
>
> #some script
>
> my $cnt=0;
>
>
>
> sub do_something {
>
> .
>
> .
>
> .
>
> }
>
>
>
> ### Main ####
>
> require c:\perl\script\file1.pl;
>
> require c:\perl\script\file2.pl;
>
> do something else;
>
> &do_something;
>
> print “something\n”;
>
> exit 0;
>
>
>
>
>
> now file1.pl
>
> ---------------------------------------------------------------------------
>
> sub file1 {
>
>
>
>   do stuff here;
>
>   .
>
>   .
>
>
>
> }
>
>
>
> 1;
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Perl
> Perl
> *Sent:* Wednesday, March 11, 2009 12:50 PM
> *To:* [email protected]
> *Subject:* Calling subroutine from different file
>
>
>
> Dear All,
>
>
>
> I have coded few scripts as mentioned below. My aim is to call the files
> and function without using a extra file ( call.pl as mentioned below) and
> with the single click.
>
>
>
> I have two files,
>
>     file1.pl & file2.pl
>
> In above files, I will call the common subroutine ( say code_send() ) which
> is  located in fun.pl .
>
>
>
> Now my task is to execute the above scripts in one click.
>
> So I thougt  to create a file by name
>
> *call.pl*
>
> here in this file I will add two system calls as below.
>
> system("perl file1.pl");
>
> system("perl file2.pl");
>
>
> I hope there is a better way to do this. If it is then please help me.
>
>
>
> Regards,
>
> Mujju
>
>
>


-- 
--
Regards,
Mujju
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to