Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!waikato.ac.nz!aukuni.ac.nz!russell From: russell@ccu1.aukuni.ac.nz (Russell J Fulton;ccc032u) Newsgroups: comp.lang.perl Subject: requires vs do expr. (PL 44) Message-ID: <1991Mar6.032242.4660@ccu1.aukuni.ac.nz> Date: 6 Mar 91 03:22:42 GMT Organization: University of Auckland, New Zealand. Lines: 22 I have a set of system administration scripts written in perl. All these scripts use a single file to define certain parameters. eg. name of password file, lock files etc. I have tried to include this file into the other scripts with both require and do but have found querks which ever way I did it. Firstly 'do expr' gives no indication of failure if the file indicated by 'expr' does not exits or can not be opened. (Is this a bug or a feature?) 'requires expr' insists that the last expression in the file be non zero. (I had to add a '1;' to the end of the file to get it to work. Requires does complain if it can't open the file. These are as much as anything a shortcoming of the documentation so please can the next edition of the book have some more details on how to use require and a warning to test for the presence of the target of 'do expr'. Cheers, Russell. -- Russell Fulton, Computer Center, University of Auckland, New Zealand.