X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2Findirect.pm;h=53dc846c35692076b047854e0aafa6f41e031276;hb=a5339a6ced4d5e3ad1541320476c3d6bf8ff9408;hp=fe39bd9123fa4b3f977b887e9ee9d86632998db8;hpb=2d1491ff7f2e6b5d845c5dc8f7631340d81bf4a8;p=perl%2Fmodules%2Findirect.git diff --git a/lib/indirect.pm b/lib/indirect.pm index fe39bd9..53dc846 100644 --- a/lib/indirect.pm +++ b/lib/indirect.pm @@ -11,13 +11,13 @@ indirect - Lexically warn about using the indirect object syntax. =head1 VERSION -Version 0.14 +Version 0.15 =cut our $VERSION; BEGIN { - $VERSION = '0.14'; + $VERSION = '0.15'; } =head1 SYNOPSIS @@ -86,10 +86,6 @@ Otherwise, a warning will be emitted for each indirect construct. =cut -my $msg = sub { - "Indirect call of method \"$_[1]\" on object \"$_[0]\" at $_[2] line $_[3].\n" -}; - sub unimport { shift; @@ -99,11 +95,11 @@ sub unimport { if ($arg eq 'hook') { $hook = shift; } elsif ($arg eq ':fatal') { - $hook = sub { die $msg->(@_) }; + $hook = sub { die msg(@_) }; } last if $hook; } - $hook = sub { warn $msg->(@_) } unless defined $hook; + $hook = sub { warn msg(@_) } unless defined $hook; $^H |= 0x00020000; $^H{+(__PACKAGE__)} = _tag($hook); @@ -122,6 +118,18 @@ sub import { (); } +=head1 FUNCTIONS + +=head2 C + +Returns the default error message generated by C when an invalid construct is reported. + +=cut + +sub msg { + "Indirect call of method \"$_[1]\" on object \"$_[0]\" at $_[2] line $_[3].\n" +}; + =head1 CONSTANTS =head2 C