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: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Perl
Perl
Sent: Wednesday, March 11, 2009 12:50 PM
To: perl-win32-users@listserv.activestate.com
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




_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to