Try this...

require 'code1.pl';
call_your_sub();

This will also execute the code in code1.pl (if there is anything outside of
a sub block), which may not be what you want.

Rob


-----Original Message-----
From: Ling F. Zhang [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2003 8:33 PM
To: [EMAIL PROTECTED]
Subject: using subroutine from another file


Let's say thatI wroute some code long time ago:
code1.pl. In the file there is this subroutine1();

now I am writting another code code2.pl, and would
like to use that subroutine1()...how do I do it
without copy and pasting it to my code2.pl?

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to