Skip to content

Conversation

@WolfgangPecho
Copy link

This allows to use the objects as subroutine objects to
ease access to nested arrays.

  • Tests and pod added.
  • No break of existing interfaces.

Changes to be committed:
modified: lib/Data/AsObject.pm
modified: lib/Data/AsObject/Array.pm
new file: t/05-function-objects.t

This allows to use the objects as subroutine objects to
ease access to nested arrays.

- Tests and pod added.
- No break of existing interfaces.

Changes to be committed:
	modified:   lib/Data/AsObject.pm
	modified:   lib/Data/AsObject/Array.pm
	new file:   t/05-function-objects.t
@WolfgangPecho
Copy link
Author

WolfgangPecho commented May 18, 2016

Hi Peter,

I needed a way to access nested data structures in an OO-like style and found Data::AsObject. I like the implementation, but found the access to nested arrays a little clumsy (cited from the pod ;-)). I implemented overload '&{}' in Data::AsObject::Array to get a nicer interface (turning it into a function object, i.e. you can use an object as function reference). It is an extension not breaking the old interface. I added pod and tests demonstrating the new interface. I hope you like it.

Ciao

Wolfgang

@WolfgangPecho
Copy link
Author

Sorry, accidentally closed my first pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant