our $host;
BEGIN {
- $VERSION = '1.22';
+ $VERSION = '1.23';
{
local $SIG{__DIE__};
eval {
sub hostname {
- @_ and warnings::warnif("deprecated", "hostname() doesn't accept any arguments. This will become fatal in Perl 5.32");
+ @_ and croak("hostname() does not accepts arguments (it used to silently discard any provided)");
# method 1 - we already know it
return $host if defined $host;
use Sys::Hostname;
-use Test::More tests => 4;
+use Test::More tests => 2;
SKIP:
{
}
{
- use warnings;
- my $warn;
- local $SIG{__WARN__} = sub { $warn = "@_" };
- eval { hostname("dummy") };
- ok($warn, "warns with an argument");
- like($warn, qr/hostname\(\) doesn't accept any arguments/,
- "appropriate message");
- no warnings "deprecated";
- undef $warn;
- eval { hostname("dummy") };
- is($warn, undef, "no warning when disabled");
+ local $@;
+ eval { hostname("dummy"); };
+ like($@,
+ qr/hostname\(\) does not accepts arguments \(it used to silently discard any provided\)/,
+ "hostname no longer accepts arguments"
+ );
}