add use
[spider.git] / cmd / show / version.pl
1 #
2 # show the version number of the software + copyright info
3 #
4 # Copyright (c) 1998 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8
9 my @out;
10 my $build = $main::version;
11
12 use IO::File;
13
14 if (opendir(DIR, "$main::root/perl")) {
15         my @d = readdir(DIR);
16         closedir(DIR);
17         foreach my $fn (@d) {
18                 if ($fn =~ /^cluster\.pl$/ || $fn =~ /\.pm$/) {
19                         my $f = new IO::File $fn or next;
20                         while (<$f>) {
21                                 if (/^#\s+\$Id:\s+[\w\._]+,v\s+(\d+\.\d+)/ ) {
22                                         $build += $1;
23                                         last;
24                                 }
25                         }
26                         $f->close;
27                 }
28         }
29 }
30 push @out, "DX Spider Cluster version $main::version (build $build) on \u$^O";
31 push @out, "Copyright (c) 1998-2001 Dirk Koopman G1TLH";
32
33 return (1, @out);