This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add note about scope in strict docs
[perl5.git] / cpan / libnet / t / smtp.t
1 #!perl
2
3 use 5.008001;
4
5 use strict;
6 use warnings;
7
8 BEGIN {
9     if (!eval { require Socket }) {
10         print "1..0 # no Socket\n"; exit 0;
11     }
12     if (ord('A') == 193 && eval { require Convert::EBCDIC }) {
13         print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
14     }
15 }
16
17 use Net::Config;
18 use Net::SMTP;
19
20 unless(@{$NetConfig{smtp_hosts}} && $NetConfig{test_hosts}) {
21     print "1..0\n";
22     exit 0;
23 }
24
25 print "1..3\n";
26
27 my $i = 1;
28
29 my $smtp = Net::SMTP->new(Debug => 0)
30         or (print("not ok 1\n"), exit);
31
32 print "ok 1\n";
33
34 $smtp->domain or print "not ";
35 print "ok 2\n";
36
37 $smtp->quit or print "not ";
38 print "ok 3\n";
39