-#!./perl
+#!perl
+
+use 5.008001;
+
+use strict;
+use warnings;
BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- if (!eval "require Socket") {
+ if (!eval { require Socket }) {
print "1..0 # no Socket\n"; exit 0;
}
- if (ord('A') == 193 && !eval "require Convert::EBCDIC") {
+ if (ord('A') == 193 && !eval { require Convert::EBCDIC }) {
print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
}
}
-use strict;
-
use Cwd;
print "1..20\n";
SKIP: {
skip('incompatible stat() handling for OS', 4), next SKIP
- if ($^O =~ /os2|win32|macos|cygwin/i or $] < 5.005);
+ if $^O =~ /os2|win32|macos|cygwin/i;
my $warn;
local $SIG{__WARN__} = sub {
};
# add write access for group/other
- $stat[2] = 077;
- ok( !defined(Net::Netrc::_readrc()),
+ $stat[2] = 077; ## no critic (ValuesAndExpressions::ProhibitLeadingZeros)
+ ok( !defined(Net::Netrc->_readrc()),
'_readrc() should not read world-writable file' );
ok( scalar($warn =~ /^Bad permissions:/),
'... and should warn about it' );
$stat[2] = 0;
if ($<) {
- ok( !defined(Net::Netrc::_readrc()),
+ ok( !defined(Net::Netrc->_readrc()),
'_readrc() should not read file owned by someone else' );
ok( scalar($warn =~ /^Not owner:/),
'... and should warn about it' );
LINES
# having set several lines and the uid, this should succeed
-is( Net::Netrc::_readrc(), 1, '_readrc() should succeed now' );
+is( Net::Netrc->_readrc(), 1, '_readrc() should succeed now' );
# on 'foo', the login is 'nigol'
is( Net::Netrc->lookup('foo')->{login}, 'nigol',