Subject: | Configurable swapped "bless" output |
I find one of the key features that Data::Dump has over Dumper is a generally nicer more human-readable output, while still being perl. One thing I've often found a little awkward is the bless() syntax, specifically the way that the class name comes after the data structure itself, which may span tens or hundreds of lines.
bless({
.... # many lines here
}, "Some::Class")
I think the output would be more readable if there was an option to use "swapped bless", by relying on a little syntax trick using a list slice (idea inspired by Altreus on Freenode's IRC), to pull the class name to the front:
bless +("Some::Class", {
.... # many lines here
})[1,0]
This way, you're already aware of what class of object you're looking at, before you read over the output.
This probably ought not be a default behaviour but it could be good as a configurable option that people can set if they'd like that sort of thing.
--
Paul Evans