9be309894b8e7402c4cffa5cdf43f1f9eb2ff22f
[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   conother => 'Sorry $_[0] you are connected on another port',
30   concluster => 'Sorry $_[0] you are already connected elsewhere on the cluster',
31 );
32
33 sub msg
34 {
35   my $self = shift;
36   my $s = $msgs{$self};
37   return "unknown message '$self'" if !defined $s;
38
39   return eval '"'. $s . '"';
40 }
41