The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Attributes are each stored twice:

 attributes => [...]
 attribute_by_key => { ... }

An attribute is stored as a hashref:

 {
  key => 'attribute_name',
  type => S|SS|N|B|NULL|BOOL|M|L,
  value => '...'
 }

new

Instantiate.

  • attributes - arrayref of attributes

each_attribute

Iterates through each attribute on this item.

bytes_used

Resolves to the total number of bytes used by this item.

bytes_for

Calculates how many bytes are used for the given type and value. Used for recursive size calculations (map/list etc.).

Returns an immediate value.

attribute_by_key

Returns the given attribute via key lookup.