home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _297dc68f3e29291d137559e4798596f1 < prev    next >
Encoding:
Text File  |  2004-06-01  |  524 b   |  28 lines

  1. #! /usr/local/bin/perl -w
  2.  
  3. use Attribute::Handlers;
  4.  
  5. sub Prefix : ATTR {
  6.   my ($glob, $sub) = @_[1,2];
  7.   no warnings 'redefine';
  8.   *$glob = sub {
  9.                  print "This happens first\n";
  10.                  $sub->(@_);
  11.                };
  12. }
  13.  
  14. sub Postfix : ATTR {
  15.   my ($glob, $sub) = @_[1,2];
  16.   no warnings 'redefine';
  17.   *$glob = sub {
  18.                  $sub->(@_);
  19.                  print "This happens last\n";
  20.                };
  21. }
  22.  
  23. sub test : Postfix Prefix {
  24.   print "Hello World\n";
  25. }
  26.  
  27. test();
  28.