1336 links
  • linx
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
  • ► Play Videos
Links per page: 20 50 100
page 1 / 1
  • Enumerating all attributes of a Moo object
    package Foo {
      use Moo;
      has a => (is => "ro");
      has b => (is => "ro");
    }
    
    my $bar = Foo->new(a => 42);
    
    # Print only 'a'
    say $_ for keys %{ $bar }
    
    # Print all attributes
    say $_ for keys( %{
       'Moo'->_constructor_maker_for('Foo')->all_attribute_specs
    });
    October 19, 2020 at 7:41:08 PM UTC - permalink -
    QRCode
    - https://www.perlmonks.org/?node_id=1043195
    attributes introspection meta moo oop perl
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation