New Log::Any Trial Release 1.041

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.

Base conversion

Earlier this year I added some commands to the ntheory module, inspired by Pari/GP and Mathematica, to split numbers into digits and put them together again. Of course this isn't terribly exciting by itself since Perl has split and join, but with optional bases it gets more interesting.

I recently took a look at the various modules that do base conversion (at least 9 modules, plus various standalone subroutines). Each has slightly different features and interfaces, and the performance at the extremes differs by over 10,000x. I've made some internal changes to ntheory based on my tests, which should show up in the next release.

Add: This is for Perl 5. Perl6 has native support for base conversions for bases 2-36 and seamless Bigint support. It Just Works. For larger bases or alternate encodings, bbkr's TinyID module can be used.

Perl don't work well in "bash on ubuntu on windows"

I tried bash on ubuntu on windows in windows 10.

Perl have problems.

File::Find dosen't work

File::Find dosen't work. In bash on windows, hard link in directory count is "2" .

In this case File::Find assume the directory don't have sub directories.

        # File::Find::_find_dir
	if ($nlink == 2 && !$no_nlink) {
	    # This dir has no subdirectories.
	    for my $FN (@filenames) {
		if ($Is_VMS) {
		# Big hammer here - Compensate for VMS trailing . and .dir
		# No win situation until this is changed, but this
		# will handle the majority of the cases with breaking the fewest

		    $FN =~ s/\.dir\z//i;
		    $FN =~ s#\.$## if ($FN ne '.');
		}
		next if $FN =~ $File::Find::skip_pattern;
		
		$name = $dir_pref . $FN; # $File::Find::name
		$_ = ($no_chdir ? $name : $FN); # $_
		{ $wanted_callback->() }; # protect against wild "next"
	    }

	}

cpan, make don't work

File::Find not working means cpan and make don't work because ExtUtils::MakeMaker depend on File::Find.

This is very bad status for Per user on bash on windows.

I hope Perl porters communicate with Windows team and have efforts to fix Perl problem on bash on windows early.

Please discuss and report this problems.

CPAN Day! Raspberry Pi wiringPi API wrapper released

I was going to hold off on announcing my new WiringPi::API distribution until my larger project that depends on it is done, but since it's CPAN day, well...

The module wraps the majority of documented and undocumented functions in wiringPi.

wiringPi is a set of C libraries that allow you to muck with a Raspberry Pi, it's GPIO pins and other things.

You can import the C functions directly keeping their original names as is:

    use WiringPi::API qw(:wiringPi);

...import the renamed Perl functions:

    use WiringPi::API qw(:perl);

...or use the module in the normal OO way:

    use WiringPi::API;
    my $wpi = WiringPi::API->new;

Thus far, my module has/can:

Nqp-js update.

nqp-js/rakudo.js is now targeting ECMAScript 6

Scott McWhirter helped a ton with the transitions (as well as with some general cleanup).
Most of the modern browsers now support ECMAScript 6 so I feel it makes sense to target it.
When targeting old ones that don't we can use polyfills and compilers from ECMAScript 6 to 5.

After doing most of the obvious and promising nqp-js optimizations I'm focusing again on getting rakudo.js to work.
Before that I'm cleaning up the nqp-js code base to remove hacks that might shoot us in the back while working on rakudo.js

A recap for CPAN day

I uploaded my 20th distribution to CPAN yesterday, a little bit premature of CPAN day but that doesn't matter. It will require an update since odd things are happening in the tests, so there will be a release today. The module is Net::AMQP::RabbitMQ::PP, a pure perl version of Net::AMQP::RabbitMQ.

I didn't write the module but when updating various libs and our version of perl here i noticed it had found its way into our stack and when cpanm didn't find the distribution i had to go hunting. It turned out the module existed on github but never made it to CPAN, so how it got into our stack i don't know.

Outthentic does not rely on Test::More any more.

Finally I decided not to use Test::More and Perl Test-Harness in Outthentic anymore.

These are the great tools proven in many many testing projects. But Outthentic tends to be more general purpose framework to run ANY scripts, rather than being a test framework only. Some testing facilitates are still here, but they poorly use a Test::More/Test-Harness entities, so I decided to rewrite story runner to get an asserts execution results in free style - so no TAP indeed is required.

$ cat story.pl 

print "hello from perl";


$ cat story.check 
hello from perl


$ strun 

/ started

hello from perl
OK  scenario succeeded
OK  output match 'hello from perl'
---
STATUS  SUCCEED

Such a changes might result in potential breakage for some sparrow plugins but I will fix it soon.

-- Regards

Alexey Melezhik

The Awesome Errors of Perl 6

If you're following tech stuff, you probably know by now about the folks at Rust land working on some totally awesome error reporting capabilities. Since Perl 6 is also known for its Awesome Errors, mst inquired for some examples to show off to the rustaceans, and unfortunately I drew a blank...

Errors are something I try to avoid and rarely read in full. So I figured I'll hunt down some cool examples of Awesome Errors and write about them. While I could just bash my head on the keyboard and paste the output, that'd be quite boring to read, so I'll talk about some of the tricky errors that might not be obvious to beginners, and how to fix them.

Let the head bashing begin!

The Basics

Here's some code with an error in it;

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.