Re: Including code from a file into the main script if the file exists

2006-09-16 Thread jeffhua
ot;; our $foo; print $foo; #get 'abcd' bar(); #get the subroutine defined in the 'user.rules' to be executed __END__ Hope this helps. --Jeff Pang -Original Message- From: [EMAIL PROTECTED] To: beginners@perl.org Sent: Sat, 16 Sep 2006 9:33 PM Subject: Including

Including code from a file into the main script if the file exists

2006-09-16 Thread Ravi Malghan
Hi: I have a script called main.pl. I want to include few lines of code from another file called user.rules if it exists. I have tried using the require statement to do that as shown below within the main.pl. if (-e "/opt/user.rules") { require "/opt/user.rules"; } I get the following error /