Log::Any 1.044 TRIAL released

Tags:

A new trial of Log::Any (1.044) has been released. This release has a couple changes that make Log::Any a bit more predictable:

  • Passing in objects to formatted log methods now handles objects that overload stringify correctly. Previously, these objects would be given to Data::Dumper, which violates object encapsulation. Thanks Philipp Gortan (@mephinet)!
  • The imported Log::Any object (use Log::Any '$log') can now be named anything (like $LOG or $foo).

Since CPAN Testers is still catching up from its little bit of downtime a few weeks ago, I won't be releasing this as stable until I get some success reports in. So, you've got some time to test this against your own codebase if you need to. Please report any issues to the Log-Any Github repository.

New Log::Any Trial Release 1.041

Tags:

I've just released a new Log::Any trial release. This release improves performance immensely when there are no log output adapters configured. This release also now returns the formatted log string from logging methods, allowing the log message to be used by a die or warn call.

Because of these changes, there is a very small chance of an incompatibility: Log::Any logging methods used to return whatever the configured adapter returned (this was undocumented and was not a feature). Now they always return the formatted log message.

So if you depend on Log::Any, please give Log-Any-1.041-TRIAL a test run through and report any issues to the Log-Any Github tracker.

List::Slice - Slice operations for lists

Tags:

How many times have you needed to do this?

my @found_names = grep { /^[A-D]/ } @all_names;
my @topfive = @found_names[0..4];

Or worse, this.

my @topfive = ( grep { /^[A-D]/ } @all_names )[0..4];

There's got to be a better way

Or this.

my @bottomfive = @names < 5 ? @names : @names[$#names-5..$#names];

Or this.

my @names
        = map { $_->[0] }
        sort { $a->[1] <=> $b->[1] }
        grep { $_->[1] > $now }
        map { [ $_->{name}, parse_date( $_->{birthday} ) ] }
        @all_users;
my @topfive = @names[0..4];

There's got to be a better way!

There's got to be a better way

Now there is! Introducing: List::Slice!

Continue reading List::Slice - Slice operations for lists...