Cross Reference:
xref
: /
illumos-gate
/
usr
/
src
/
cmd
/
perl
/
5.8.4
/
distrib
/
lib
/
Attribute
/
Handlers
/
demo
/
demo_chain.pl
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
demo_chain.pl revision 7c478bd95313f5f23a4c958a745db2134aa03244
#! /
usr
/
local
/
bin
/
perl
-w
use
Attribute
::
Handlers
;
sub
Prefix
:
ATTR
{
my
($
glob
, $
sub
) = @_[
1
,
2
];
no
warnings
'redefine'
;
*$
glob
=
sub
{
print
"This happens first\n"
;
$
sub
->(@_);
};
}
sub
Postfix
:
ATTR
{
my
($
glob
, $
sub
) = @_[
1
,
2
];
no
warnings
'redefine'
;
*$
glob
=
sub
{
$
sub
->(@_);
print
"This happens last\n"
;
};
}
sub
test
:
Postfix
Prefix
{
print
"Hello World\n"
;
}
test
();