Thread Konstanten in Modulen (13 answers)
Opened by format_c at 2005-02-13 15:43

format_c
 2005-02-13 15:43
#51657 #51657
User since
2003-08-04
1706 Artikel
HausmeisterIn
[Homepage] [default_avatar]
Hi.

Ich möchte Konfigurationsdaten in einem extra Modul auslagern und schreibgeschützt als Konstanten definieren. Wie kann ich auf diese Konstanten aus einem Anderen Modul od. Perl Skript zugreifen??

Exporter?? Aber irgendwie will es nicht so:
Code: (dl )
1
2
3
4
5
6
7
8
package mymodule;
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(NAME);

use constant NAME => 'Alex';
package main;
print NAME;

Gibt nichts aus.

Kann mir jemand mal bitte auf die Sprünge helfen?

Gruß Alex

View full thread Konstanten in Modulen