But any damn fool can see that it’s 2 lines of code instead of 2 characters. It’s not more readable. It’s just foolish. Some parts of smart match suck and I get that. So throw out those cases, not smart match itself.
This is my first post here and it will be a short one.
I was asked to count chinese characters in a string. Most of us know the annoying task of writing an essay with $n words. For chinese it will be $n characters.
Would be a shame if we take this too serious and write too much.
so:
my Str $text = "你好! 我喜欢吃菜!";
$text ~~ s:g/ \W | \d //;
say $text.chars;
And that's it.
So why even blog about it? What I think is amazing is that all worked with the first attempt.
I often just try stuff in perl6 without knowing if it will work the way I think it will work.
However most of the time, it just does... and this is why I love this language!
craigslist is sponsoring the Wednesday Night Pull Request Challenge at YAPC::NA::2016 on 6/22 at 6pm-10pm (or 'til). This event is modeled, inspired, and loosely affiliated with Neil Bower's fun and successful "CPAN Pull Request Challenge" .
A primary goal of this event is to introduce participants to the wonderful world of contributing to the Perl ecosystem.
This is a beginner friendly event, and assistance will be given to anyone needing help getting started.
To make things even easier, there will be a list of eligible modules to choose from. Participants may also come with their own projects and modules to work on.
So To carry on from my last short post another short post. I am going to expand and modify my 20_dad_load.t again this time digging a little deeper in Moose's MOP or to give its full name 'Meta-Object Protocol'
One of the things I like most about moose is how easy it is to do “Introspection” or I like to say 'Lets have a look under the hood'. So I have expanded my role test from the other
day
to this
I needed to do some work with splunk the log and monitoring analytics toolkit. Specifically I needed to combine disparate logs from different systems to solve a problem that had been intefering with our systems for a long time. I had a look around for stuff on the CPAN, but it was either embedded into other bigger things that I didn't want to have to deal with, or did not work for me for maintenance reasons. So I decided to write my own. The library I wrote is available here in draft form.
Now because this was written by me for debugging purposes, I think it shouldn't be a CPAN module - not without a lot of hardening it up - but I wanted to share it anyway, as a handy way of doing API integration.
I my last post I did create a Test DAD, but then I discovered the problem with doing this is you may spend considerable time just debugging that class to make sure it at least works with any roles it may have to consume and even if you get it to work you may have problems with the roles it is trying to consume.
So I really should test my Database::Accessor::Roles::DAD before I start any load tests,. My basic test I did in a previous post it a good start bur I want to be able to test it before I have says a 100% good DAD. So Moose come to the resque again with MooseX::Test::Role
With this
MooseX
I can test my role without a 100% perfect consuming class as it just stubs in any subs the role may require. So in
20_dad_load.t
I add in
Are we a support group for disenfranchised Perl developers or advocacy group for all developers? If we want people to join our community then we need to reach out and do some good in theirs.
Do you want to get latest Perl information? If you get newer Perl information, you can know the information faster than others.
I'm Yuki Kimoto. I'm Japanese Perl programmer. I have twitter account. Until now I only tweet newer perl information using Japanese. but from know I tweet using Both Japanese and English.
I tell you what I find, what I think it is good about Perl(perl core feature, web application, cpan module), and my perl product release such as GitPrep.
I'm sharing many topics from now. I add simple description from my experience of professional Perl programmer. If you follow my twitter account, I can tell you good Perl information.
So in today's Moose pen I am going to stick to the testing tree and have a look at my brand new 20_load_dad.t file in my brand new database-accessor repository
Now in past test
cases
like this, I did a little creative coding and made up a fake test class for SQL and Mongo drivers that where used when I called this
my $fake_dbh = DBI::db->new();
ok(
$address->retrieve( $fake_dbh, $result ) eq
'SELECT street, city, country FROM person AS me',
'SQL correct'
);
I've been programming in Perl 5 since 2001 or so. In 2012, I took a brief look at Perl 6 just to see what it was all about, and wrote a simple blog entry describing some of the basic changes between P5 and P6. I promptly walked away from the language until a week ago.
Over the course of the last week, I decided that I want to go full-out and really learn the language. My goal was to port my File::Edit::Portable P5 module to P6. This module saves record separators from a file, then when writing back, it re-uses the saved line endings. So if you open a Windows file on a Unix system, it'll re-write the file with the original Windows line endings.
So today in the Moose-pen I am not going to any coding just another of those little planning review sessions one should take when creating a new system.
So for the two-bit review,
Planned out and amended my basic API
Settled on the basic architecture
Done some PoC programming
Now know where som of the problem area will be.
Have some workable tests
So my next step was to migrate all my code out from the blog repository up on git-hub and into its own git-hub repository which I have done. I also want to set this up the same way I would do a Perl distribution so I stubbed in some of the necessary files namely a README, a Makefile.PL and the GNU license.
Next I had a close look at the present state of the code. I only moved over the code directly related to Database::Accessor name-space, at this point is just the Accessor.pm file and its embedded classes.
My main activity is GitPrep this year. I plan to add issue system and wiki system. But I'm hangry. I want to do more about Perl.
Python has pypy. This is a static implementation of Python. Perl don't have yet tools like pypy.
In this month, I create only main syntax structure of static perl. OP tree and virtual machine are not yet created.
The purpose is fast compile, fast runtime, fast culculation, parallel, GC.
These are the lack of perl language.
And I also want to implement static perl as XS in order to call static perl library from Perl language.