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.
  • use base qw( Class::Accessor::Fast );
    __PACKAGE__->mk_accesors(qw( from date subject size folder source ));

    See: Class::Accessor [cpan.org]

  • Attribute::Property
    use Attribute::Property;

    package My::Class;
    sub foo : Property;
    sub bar : Property;
    sub baz : Property { /^\d+$/ }
    This has the advantage of being able to use them as lvalues, like in Perl 6:
    $foo->bar =~ s/foo/bar/;
    instead of:
    my ($temp = $foo->bar) =~ s/foo/bar/;
    $foo->bar($temp);