home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2005 June
/
PCWorld_2005-06_cd.bin
/
software
/
vyzkuste
/
firewally
/
firewally.exe
/
framework-2.3.exe
/
demo_chain.pl
< prev
next >
Wrap
Perl Script
|
2003-11-07
|
497b
|
28 lines
#! /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();