Every subroutine has a .wrap method. This method expects a single
argument consisting of a block, closure or subroutine. That argument
must contain a call to the special call function:
[/quote]
"Must"?
Or, "should"?
That is, can I say:
sub shaddap()
{
&print.wrap { 1; } # No printing right now.
}
and have it work, or will this (by virtue of not referencing "call")
fail due to some sort of "Block supplied where Wrap expected" type
checking error?
=Austin
"Should" is more like it.
: That is, can I say:
:
: sub shaddap()
: {
: &print.wrap { 1; } # No printing right now.
: }
:
: and have it work, or will this (by virtue of not referencing "call")
: fail due to some sort of "Block supplied where Wrap expected" type
: checking error?
It's probably worth a warning if you supply a wrapper that doesn't
wrap, but it's also probably worthwhile to be able to turn the
warning off.
Larry