shared hash keys and ++/--
[p5sagit/p5-mst-13.2.git] / lib / Net / t / hostname.t
CommitLineData
302cc833 1#!./perl -w
2
3BEGIN {
4 unless (-d 'blib') {
5 chdir 't' if -d 't';
6 @INC = '../lib';
7 }
8b14f033 8 if (ord('A') == 193 && !eval "require Convert::EBCDIC") {
9 print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
10 }
302cc833 11}
406c51ee 12
13use Net::Domain qw(hostname domainname hostdomain);
14use Net::Config;
15
16unless($NetConfig{test_hosts}) {
17 print "1..0\n";
18 exit 0;
19}
20
0d375cdb 21print "1..2\n";
406c51ee 22
23$domain = domainname();
24
25if(defined $domain && $domain ne "") {
26 print "ok 1\n";
27}
28else {
29 print "not ok 1\n";
30}
0d375cdb 31
32# This check thats hostanme does not overwrite $_
33my @domain = qw(foo.example.com bar.example.jp);
34my @copy = @domain;
35
36my @dummy = grep { hostname eq $_ } @domain;
37
38($domain[0] && $domain[0] eq $copy[0])
39 ? print "ok 2\n"
40 : print "not ok 2\n";