Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Or you can use Lexical::Attributes and you can write:
    use Lexical::Attributes;

    class MyClass;
    has ($.foo, @.bar, %.baz) is rw;
    sub new {bless \do {my $v} => shift}
    method something {
        # Look, no '$self = shift' needed.
        $self -> whatever ();
        return $.foo + $.bar [1]
    }
    • Is Lexical::Attribute more like Perl6 attributes than Perl6::Attributes is?
      --
      Bill
      # I had a sig when sigs were cool
      use Sig;
      • I don't know. To be perl6ish was only a minor issue for Lexical::Attributes. And in certain ways, it deviates on purpose (private attributes also use a dot as a secondary sigil - I don't share Larry's opinion that it's important to have a visual difference between private and non-private attributes)
    • Thank you for your advice, Abigail.

      Yep, Lexical::Attributes seems to be more Perl6-ish and hence even more revolutionary.
      But it also deserves more effort to get used to the syntax in Perl5 modules. :=)