On Tuesday, May 28, 2002, at 12:51 , Jason Frisvold wrote:
> I follow completely... The idea behind the library.pm file is for it to > basically be an include file ala C/C++. The intent is to not re-write > the same functions over and over again... > > With the exception of using it in an actual package (ala the > mypackage.pm example), this is used successfully in a few dozen other > programs.. Basically he just puts a 'use library;' at the beginning of > the program, calls the needed subs and goes on his merry way. > Everything joins the main namespace... It's when he places it in both > the package and the main that it causes this error... what I would recommend is that IF you are going to have a common set of defined items that you do the right thing all the way through the game - and go back read up on h2xs - so that you spin these up appropriately and make sure you export what you need. This way you really would move forward into the process of having a real 'base class' from which you would be subclassing, if you wanted to stay in the OO motif.... IF what you want is a 'common configuration' file that is parsable by a lot of common files - you can either go directly to that with the standard sorts of http://www.wetware.com/drieux/pbl/Sys/ParseConfigFile.txt or make a simple PM that does nothing but export the declared variables that you want.... I use that sort of trick in my dump2disk gag cf - http://www.wetware.com/drieux/CS/Proj/dump2disk/ but I expressly all out that I am contaminating things with %EXPORT_TAGS = ( 'all' => [ qw( get_FSTAB get_os_specifics $backup_dir @day_list %osHash ) ] ); two functions and three variables.... since the functions are needed in all of the pieces of code, and it was just simpler for me to pass the variables along as well so that I had them expressly exported so that I did not need to do the $Wetware::dump2disk::backup_dir; so it really depends upon where you are trying to save your time and how you are trying to manage your name space issues. ciao drieux http://www.wetware.com/drieux/pbl/ -------------- This space left intentionally blank. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]