In the error message, name the POSIX function that was called, as well as
the suggested replacement method. This rephrasing was in the patch
supplied by Aristotle Pagaltzis, but I have retained the existing POSIX
use of :: when describing the method, because given two less than great
choices, I'm inclined to favour retaining the status quo and one change
over two changes.
croak "Unimplemented: POSIX::$func() is C-specific, stopped"
unless defined $how;
croak "Unimplemented: POSIX::$func() is $$how" if ref $how;
- croak "Use method $how() instead" if $how =~ /::/;
+ croak "Use method $how() instead of POSIX::$func()" if $how =~ /::/;
croak "Unimplemented: POSIX::$func() is C-specific, use $how instead";
}
[vsprintf => 'C-specific, stopped'],
) {
my ($func, $action) = @$_;
- my $expect = ref $action ? qr/Use method $$action\(\) instead at \(eval/
+ my $expect = ref $action
+ ? qr/Use method $$action\(\) instead of POSIX::$func\(\) at \(eval/
: qr/Unimplemented: POSIX::$func\(\) is \Q$action\E at \(eval/;
is(eval "POSIX::$func(); 1", undef, "POSIX::$func fails as expected");
like($@, $expect, "POSIX::$func gives expected error message");