Guten Tag Marcel Loose, am Mittwoch, 9. März 2011 um 17:51 schrieben Sie: > Now what do we conclude from this? > Should /usr/share/scmbug/lib/Scmbug/Daemon/Bugzilla.pm be fixed > accordingly? I.e., should the assignment to $self be put inside a > BEGIN-block?
There's no $self in the BEGIN block because those blocks are used at compile time, but $self is a reference to a blessed object created at runtime. It's a chicken-egg-problem. What can be done is to write separate class functions to read the configuration just for this purpose, read the Bugzilla installation directory and use it with use lib. We do something similar in our CGI-Scripts: A special file is read which consists of a list of paths which should be added to @INC in the BEGIN block during compile time. This works, meaning that you can read files etc. in the BEGIN block and as you say that the example works, one can add to @INC using use lib, which we don't at the moment in our programs. What should be done is like the following: * create some class function * read SCMBug configuration * eval file content * use lib with Bugzilla installation directory from evaled content, which is just a hash now Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig Telefon: Potsdam: 0331-743881-0 E-Mail: [email protected] Web: http://www.am-soft.de AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow _______________________________________________ scmbug-users mailing list [email protected] http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users
