Test::Stream: Have your cake and eat it too!

*** UPDATE ***

After this was written I received feedback from several respected members of the community alerting me to the problems that could be caused by is() *guessing* if it should be comparing numbers or strings. After hearing this feedback I agreed that the behavior constituted a bug, and one serious enough to alter the behavior post release. Test::Stream was marked *stable* recently enough that the change should not impact very many people, if in fact any.

The latest version of Test::Stream on CPAN no longer guesses if it is given a number vs a string.

In the very near future cmp_ok, and a 'Classic' bundle which provides just the functionality of Test::More, including classic 'is' and 'is_deeply' will be released, and will be the recommended bundle for people moving from Test::More. Branches and pull requests for both of these have been written, I am giving them some time for review before proceeding with their release.


Perl 5 Porters Mailing List Summary: October 20th-26th

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past week (including Monday the 26th). Enjoy!

List::Slice - Slice-like Operations for Lists

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!

A Date with CPAN, Part 3: Paving While Driving

[This is a post in a new, probably long-ass, series.  You may want to begin at the beginning.  I do not promise that the next post in the series will be next week.  Just that I will eventually finish it, someday.  Unless I get hit by a bus.]


Last time I went into more details about how I might go about creating a new date module, and what I would expect it to achieve.  This time we clear out some housekeeping and try to nail down a design strategy.

Test::Stream going stable

Test-Stream, the intended successor of Test-Simple (Test::Builder, Test::More), is moving out of the experimental phase. The experimental notice has been removed from all but a couple modules in the distribution. Now is a good time to start writing new testing tools using Test-Streams capabilities.

What does this mean for Test::More, Test::Builder or my existing test tools?
At the moment it means very little. Test::Builder is still around, and not going anywhere any time soon. At the moment Test::Builder based tools and Test::Stream based tools will not work together in a single test script, though they can both be used in different files in a single test suite.

HTTP::Response may have a different definition of success than you do

The is_success() method which HTTP::Response provides is not necessarily a full indicator of success. This has bitten me before, so I thought it was worth writing about. Perhaps it may save you some heartache down the line.

Read the full post.

More Dancer2 goodness

Task::Dancer2 0.04 and Dancer2::Plugin::Queue 0.005 are on their way to CPAN. D22::P::Queue had test failures preventing it from installing. Task::Dancer2 re-enabled Queue in the bundle, and also the REST plugin.

Enjoy!

Outthentic - yet another test framework

Outthentic is a black box testing framework.

Instead of hack into objects and methods it deals with text appeared in stdout.

This is very first CPAN release to play with:


$ cpanm Outthentic

This is super fast intro:

Perl 5 Porters Mailing List Summary: October 12th-19th

Hey everyone,

I apologize for the delay. This summary should have been sent yesterday but I was busy at the Dancer Conference in Vienna.

Following is the p5p (Perl 5 Porters) mailing list summary for the past week (including yesterday and this morning). Enjoy!

A micro contribution to Perl

When you see an article on Reddit /r/perl upvote it. If you see an article about Perl that is not on Reddit yet, post it.

Dancer2 module updates now on CPAN

Last night Task::Dancer2 0.03 and Dancer2::Session::JSON 0.002 made their way to CPAN. Thanks to xdg and Yanick for their help with this. More updates to come in the following days.

Thank you to those who attended and sponsored the Perl Dancer Conference 2015 in Vienna this week! Looking forward to seeing you next year (sorry I had to miss this one).

Most importantly, thank you to the Dancer Core Team for extending an invite to me. I am proud to be one of you :)

The Old Becomes New Again: A Gopher Server in Perl 6

The web is slow. Between overloaded pages, overloaded servers, bloated browsers, and ISP throttling, it's not unusual for even simple pages to take a couple seconds to load. But you get used to it, so I was struck by how fast the Internet can actually be when I fired up a gopher client recently.

Yes, gopher still exists, barely. For those who are unfamiliar with it, gopher is a sort of text-based hypertext system that predates the web -- think the web minus graphics, fonts, and interactive scripting, just files and directories and links between them, though you can also offer a few other things like search services. I miss those specialized services like gopher, IRC, and Usenet, that did one thing very well before they were overwhelmed by the web.

6.concerns

My thoughts on the upcoming Christmas

Perl5 to Java compiler - first little script

For the first time, Perlito5-Java can now run an unmodified script - "rc-forest-fire" from the perl6-bench project.

I've experimented running the benchmark on the several Perlito5 platforms, and on perl itself:

swatpm.org updated

Site has become quite concise but has interesting info about swat:

  • fork me on github button :) - this one is classic
  • 1 minute tutorial on swat tests
  • list of projects using swat ( more ones are wanted! :) )
  • list of swat examples

New Dancer2 release en route to CPAN: 0.163000 and new core dev!

Hi everyone,

We have another great Dancer2 release hitting CPAN as we speak. This time with an announcement on a new core dev joining the Dancer team: Jason Crome. Please give him a warm welcome! We're very happy to have him join us and help make Dancer2 more approachable and welcoming to new-comers.

We're very excited about this release as it carries some great changes and new features.

Hey, Speaker: Join Cluj.PM #9! Yes, YOU!

call4speakerz#9.jpg

Cluj.PM is back in town! After getting back from YAPC::EU 2015, we have a hell of a lot to celebrate: bringing YAPC::EU 2016 to Cluj doesn't happen every day, so let's get together for another round of Perl talks & a social event afterwards on November 19th, 2015, at our usual meeting place: City Plaza Ballroom.

So who's our Guest Speaker? Cluj Community, meet Andrew Shitov, organizer of more than 30 Perl events in the Cyrillic territory and a couple of YAPC::Europe, Riga and Kiev.

And who are the other speakers? Well, YOU, so we'd like to hear from you as soon as possible!

If you are interested in giving a talk, you should know that your topics may cover anything related to Perl development, entrepreneurship, UI, business, devops, and why not, even other related programing languages! Be creative and surprise us with some really special talk proposals. We know you have it in YOU!

Divas Need Not Apply

A couple of days ago, we posted a job on jobs.perl.org. We wrote:

Description: Want a remote Perl job working for a great company with colleagues from all around the world? We're considering both permanent and contract positions for a variety of Perl roles. Front-end skills are always welcome and experience with parallel programming comes in handy more than you would think.

We do set a high bar on who we employ, so if joining a bunch of Perl hackers who love the language sounds like fun, send us your CV and we'll send you our programming test. In return, because we value your time, Ovid will be evaluating the test and will send you feedback on how you did and areas for improvement, if any.

Desired skills: Perl. Strong Perl. You love the language. This is the only solid requirement.

Front-end skills (HTML, CSS, JS, not design) are often very useful.

Expertise with parallel processing, including event-driven programming, is needed.

Good communication skills.

Understanding databases is important.

New Design for PerlTk.de

In case you do speak German, or know how to use Google Translate, you can have a look at the new shiny Design of my page PerlTk.de.

It's intended as a Perl/Tk widget reference with a target audience of German noobs that would like to code a UI in Perl.

I hope you like it. Here is something to look at:

perltk.de-new-design-mobile.png

Now, the only things left is to get Widget styles in Tk and eventually get a Perl6 Tk binding. One with the same amount of sugar and hopefully less of what is not so good in Tk today :)

Apparently tonight’s MadMongers meeting about SVG will be a...



Apparently tonight’s MadMongers meeting about SVG will be a Micky Mouse operation. 

[From my blog.]

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.