in reply to Re^4: RFC: Simulating Python's @decorators in Perl with Attributes
in thread RFC: Simulating Python's @decorators in Perl with Attributes
Importing the attribute does not seem to work:
It dies with# Foo.pm package Foo; use strict; use Attribute::Handlers; use Exporter 'import'; our @EXPORT = qw/Sorted/; sub Sorted :ATTR { print "all sorted" } 1; # attr.pl #!/usr/bin/perl use strict; use warnings; use Foo; my Foo $tst1 :Sorted; my $tst2 :Sorted; print "done\n";
Invalid SCALAR attribute: Sorted at /home/arun/attr.pl line 8.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: RFC: Simulating Python's @decorators in Perl with Attributes (exporting attributes)
by LanX (Saint) on Jun 02, 2013 at 20:03 UTC |
In Section
Meditations