sorted out inheritance
[spider.git] / perl / DXM.pm
1 #
2 # DX cluster message strings for output
3 #
4 # Each message string will substitute $_[x] positionally. What this means is
5 # that if you don't like the order in which fields in each message is output then 
6 # you can change it. Also you can include various globally accessible variables
7 # in the string if you want. 
8 #
9 # Largely because I don't particularly want to have to change all these messages
10 # in every upgrade I shall attempt to add new field to the END of the list :-)
11 #
12 # Copyright (c) 1998 - Dirk Koopman G1TLH
13 #
14 # $Id$
15 #
16
17 package DXM;
18
19 require Exporter;
20 @ISA = qw(Exporter);
21 @EXPORT = qw(msg);
22
23 %msgs = (
24   l1 => 'Sorry $_[0], you are already logged on on another channel',
25   l2 => 'Hello $_[0], this is $main::mycall located in $main::myqth',
26   pr => '$_[0] de $main::mycall $main::cldate $main::ztime >',
27   e1 => 'Invalid command',
28   e2 => 'Error: $_[0]',
29 );
30
31 sub msg
32 {
33   my $self = shift;
34   my $s = $msgs{$self};
35   return "unknown message '$self'" if !defined $s;
36
37   return eval '"'. $s . '"';
38 }
39