super_drone has asked for the wisdom of the Perl Monks concerning the following question:
Trying to learn/use subroutine attributes. However, can't seem to take very first steps :(
Following example code, gives an error:
Invalid CODE attribute: hold at ./attr.pl line 6
What am I doing wrong?
Thanks for you help.
where attr.pl is :
----------------------------- #!/usr/bin/perl package XYZ; use strict; sub abc :hold { } sub MODIFY_CODE_ATTRIBUTES { my ($pack,$ref,$attrs) = @_; (); } sub FETCH_CODE_ATTRIBUTES { return ('hold'); } 1; __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: learning subroutine attributes
by davorg (Chancellor) on Sep 20, 2006 at 14:03 UTC | |
|
Re: learning subroutine attributes
by adrianh (Chancellor) on Sep 20, 2006 at 17:14 UTC |