Perl Module Tools (pmtools) v2.1.2 Released - Version Fixed
Perl Module Tools v2.1.2 has now been released to fix the version number everywhere.
Perl Module Tools v2.1.2 has now been released to fix the version number everywhere.
Test postette day again here in the Moose Pen.
Time to re-run my tests suites again to check the 'Sate of the Onion' before I move on. I expect this will be a very short post.
For Database::Accessor as expected I did not have many changes since last week
2 files changed, 70 insertions(+), 24 deletions(-)
and the test run was;
All tests successful.
Files=29, Tests=490, 81 wallclock secs ( 0.23 usr 0.06 sys + 77.55 cusr 1.71 csys = 79.55 CPU)
Result: PASS
Now Driver::DBI which had a modest number of changes;
6 files changed, 358 insertions(+), 45 deletions(-)
and the test results for it are;
I live in an extremely remote part of Northern British Columbia, Canada. It is a minimum of an hour to get to the nearest town. We are exceptionally sparsely populated with a vast amount of land right on the second-largest lake in the province.
To that end, we have a wild abundance of wildlife everywhere. Bears, moose, wolves, coyotes, deer etc etc. I set out to set up a series (eight) wildlife cameras using Raspberry Pis (four on my house, the other four each on a separate cabin), all streaming to a central server that I can display on a television set, with all eight camera streams within a single window.
After I accomplished the bulk of that work, I wanted a way to pan and tilt my cameras individually. The tilt part I use a standard servo with the the servo()
functionality of the RPi::WiringPi distribution.
Last year I released this new module.
I want to talk about its purpose briefly, because in the time since, people have published benchmarks of how it performs compared to other modules that offer alternatives to eval
. The latest example of such a benchmark is part of the Exceptions chapter in Minimum Viable Perl (via), but they go as far back as Diab Jerius’ shootout right after I released the module.
It is, of course, interesting to see the figures to see where Try::Tiny::Tiny falls.
However, simply treating it like another contender in such a contest misunderstands its purpose. Try::Tiny::Tiny is not meant to compete with any of the other modules. It is not meant to be your choice for exception block syntax.
I do not recommend that you use Try::Tiny::Tiny in your own code.
Hey, I'm not dead! I just haven't posted in a while because I've been so busy on Tau Station (which, if all goes well, will be open for everyone real soon).
In the meantime, I've written a bit about building a software consulting firm. You might find it interesting.
If you need to outsource software development with a firm you can trust, contact us.
ts final Case postette day here in the Moose-pen
For the final clean up of Case I am going to add in a few tests in Database::Accessor that should have been there in the first place.
First I will add this;The latest TPC Newsletter is out!
Last round of talks submissions. CFP closes 3/18/18!
I'll be back in Lausanne again this May...my tenth visit to UNIL and my second to EPFL. Both of these prestigious institutions were founded well before my own country became an independent nation (and UNIL actually dates back to 50 years before the first European even set foot on the Australian continent).
To celebrate a decade of visiting lectures at the University, we're going to offer a rare public performance of my classic Fun With Dead Languages presentation. It's many years since I had the chance to give the full two-hour version of this talk and I've been busily updating it for the occasion. The talk is completely free, but we do want people to register in advance if possible so we can schedule a suitable venue for it.
In addition to that event, of course, we'll still be running a full range of classes on technical and presentation topics:
This is a really stupid (and kludgy) Stupid Lucene Trick: how do you search the full text of your document + metadata without the full text? Simple - you create a separate field (call it fulltext, for example), then populate it with the text of all of your other fields. Voilà! You can now search against "fulltext" for all of the text in your Lucene document without having to know whether, for example, "physical" is in the document body, the abstract, or only in the keywords.
Note that fulltext should be created dynamically from the fields for the particular document, rather than from a fixed set of named fields so you maximize the amount of text you can search against.
And yes, you are duplicating the text of the all of the other fields in this field :(.
It case out day here in the Moose-Pen
After looking at some more examples of 'CASE' in SQL I cam across one I have not encountered yet;
SELECT CASE
WHEN Products.Price < 10 THEN 'under 10$'
WHEN (Products.Price >= 10
AND Products.Price <= 30)
OR (Products.Price >= 40
AND Products.Price <=50) THEN '10~30$ or 40~50$'
ELSE 'Over 50$'
END
FROM Products
As you might know I wrote the Perl Maven Tutorial along with most of the 800 other posts on the Perl Maven site during the past 6 years or so.
It became the most frequently read Perl Tutorial and the site is the 4th most visited Perl-related site after cpan.org, perl.org, and perlmonks.org.
I've received many comments on the individual articles that make up the Perl Tutorial. Some required and immediate fix or answer, but many included suggestions that need a lot more work to implement.
There are also a number of missing articles. Some can be seen as comments in the source of the Perl Tutorial page.
It is time to update the tutorial incorporating the comments made on the individual pages,
filling in holes where some topics have not been covered, and making the whole tutorial more like pages of a book.
I need your help in two ways:
Hey everyone,
Following is the p5p (Perl 5 Porters) mailing list summary for the past two weeks.
Enjoy!
Another Case Day here in the Moose-pen
So I decided to do some more case work today specificity their rather odd little SQL to start;
SELECT CASE WHEN Price < 100 THEN 'under 100$'
WHEN Price in (105, 110,120) THEN Price 105,110 or 120$'
ELSE 'Over 120$' END
FROM Products
and the above comes out as this test;
I have a piece of Perl containing manifest constants that have the same value, but which signify different things. In my testing, I wanted to make sure I was getting the right one out of my code. That seems to mean changing code to test it, which is anathema to me.
It occurred to me today that if I held my tongue right I could change the values of the constants without touching the code they were defined in or exported from. Holy aspect-oriented programming, Batman!
The trick is based on the fact that what use constant
really does is to define a constant subroutine with an empty prototype. Now, Perl will allow me to redefine a subroutine -- grumpily if use warnings qw{redefine}
is in effect, and happily if not. So I thought all I had to do was load the module that exported the constant, hammer its symbol table, and voila!
We are delighted to announce The Swiss Perl Workshop 2018. This year the workshop will be held in Bern at Gewerblich-Industrielle Berufsschule, an industrial vocational school. The workshop will be held in English, although of course other languages are welcome.
The workshop will take place on Friday 7th and Saturday 8th of September 2018 and thanks to the generosity of the school the workshop will be free to attend. As the venue is a technical school we hope to attract students and teachers, so this year's workshop may be an ideal place to promote Perl to those who have not yet heard of or used the language.
Please spread the word, register, submit talks, and come enjoy a perl workshop in Switzerland's historic capital city. You will find more details over the coming weeks added to the official workshop site.
As always, many thanks to our sponsors: We are looking for more sponsors. Interested? Please check the sponsoring page.Encode is a well known core module in Perl with support for encoding and decoding text from almost any character encoding you can think of. But it's also an old module with a large amount of historical cruft.
With inspiration from #perl on freenode IRC, Encode::Simple is an attempt to at least improve on its interface and usability issues. Rather than an awkward and unintuitive bitmask and the option of clobbering the input data, Encode::Simple exports straightforward encode and decode functions that simply return the encoded or decoded result or throw an exception. For the cases where you want to allow invalid characters or byte sequences, encode_lax and decode_lax are provided.
Encode itself supports many more operations such as partial, mixed, and in-place encoding or decoding, where its options may make more sense, but these uncommon use cases are not supported by Encode::Simple.
As a final note, if you are working strictly with UTF-8, I suggest avoiding Encode entirely and using the excellent Unicode::UTF8, or the related filehandle layer :utf8_strict, for fast and correct encoding and decoding.
Its Sort the Case day here in the Moose-Pen
It appears that one of the more common uses for the CASE statement in SQL is in a 'GROUP BY' or at least a good 80% of the tutorials for SQL I have looked at have it as an example so let see how well the present Driver::DBI handles it.
To start I just add this test to the '60_order_by.t' test case;It turns out there are several tools in the Perl Module Tools (pmtools) that need to execute other commands with the current Perl specified, like:
system "ls -l " . `$^X -S $Bin/pmpath $module`;
(note the additional "$^X").
As a side note, in Windows you may need to "use FindBin qw($Bin);" so your programs can actually find the Perl to run. (I had wondered if this use of FindBin was just cargo-cult programming carried over from old versions of Perl - now I know better.)
2nd Round talk submissions are open until Sunday! We hope you're planning to submit.
https://goo.gl/forms/m7gAPFXsgd2CQ2OG3
#TPCiSLC
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.