The first three installments of this series covered Perl's core data types: scalars, arrays, and hashes. This final
installment will cover something a bit different: the optree. Those of you who are familiar with compiler concepts
are no doubt familiar with the notion of an abstract syntax tree (known as an AST for short). The optree is perl's
take on the AST: it's something similar to, but not entirely the same as, an AST. Before we begin looking at the
optree, I recommend reviewing the “Subroutines” and “Compiled code” sections of perlguts, as well as
looking at perlcall. It is by no means required, but it might make digesting this content a little
easier.
Here are some comments on the mop-redux regarding situations in which Perl OO (code) is thought to newcomers or to outsiders. Such situations could be explaining code to an non-Perl colleague at work for a holiday substitution or a Perl class in high school.
So, I finally got around to reading the introduction that dams put together for p5-mop. (If you don’t know what that is, it’s the effort to get a MOP, or “Meta-Object Protocol,” into the Perl 5 core. This would not be adding Moose to Perl 5, but it would be adding something that would make Moose—or any competitors—a lot more feasible, efficient, and user-friendly.) I’ve been following Stevan’s blog posts about the ongoing work, but a lot of times those are more about certain implementation details. They’re very useful, and very interesting, and I hope he continues to do them, but sometimes they can be a bit forest-for-the-trees, if you see what I mean. I think it was great of dams to give us a 6,000 foot view, as it were.
I am particularly interested in solutions which make the semantics of the code very clear to the code maintainer.
Sinan's answer works. He handles the cases where the array reference has zero, one, and and more than one elements. In his solution for more than one element, he uses a special case where an array slice will return zero elements when the "high" number of the range is less than the "low" number and the special case where a join with one list item returns only that item. The collapses two cases of the problem into one:
method keyword is the syntax to write method simply.
method clear {
# You can omit "my $self = shift" by method keyword
$self->x;
}
And method keyword give Perl ability to know it is subroutine or method.
I think that method keyword isn't part of Meta Object Protocol even if mop use it as the part of module features. method keyword is independent feature.
If so, we can implement method keyword before mop release. Big jump is hard, small jump is good. If method keyword can work independent feature, I think it is good that method keyword is implemented into Perl core before mop release.
And user which don't use mop can get the benefit of method keyword. And anonymouse method can be implemented.
Welcome to the second edition of Planet Moose, a brief write up on what's been happening in the world of Moose this month, for the benefit of those of you who don't have their eyes permanently glued to the #moose IRC channel, or the MetaCPAN recent uploads page.
Thanks for contributions from Damien Krotkine and Stevan Little. If you'd like to contribute some news for next month's issue, you can do so on the wiki.
Having this collection is useful for developers who would like to understand Dist::Zilla more.
In case you know about any other articles, please send a pull request for the dzil.org repository.
The specific file is articles.pod. (For some reason Github only shows the title, but if you click on edit it allows you to edit the whole file.) Entries are listed by their date.
Perl Debugger is very useful tool. but I think yet many people don't know the way to use Perl debugger well. If you can use debugger well, Speed of development increase and decrease bugs. Let's use debugger more!
This module disables the peephole optimiser so that you can see what the op tree would look like before it works its magic (and benchmark the differences, if you like).
The road show continues! This time, I will be presenting Pinto at the Silicon Valley Perl Mongers meetup this Thursday, October 3. So come out and learn how a private CPAN made with Pinto can save you from hours of needless debugging AND make you more productive with Perl. Full details at the Meetup link below:
You can learn object orientation basic, "Inheritance", "Encapsulation", "Polymorphism". I use Object::Simple module to describe object orientation. This is Mojo::Base porting to single module.
A couple weeks ago, Andy Gorman sent a patch for a new Pinto command that displays the perldoc for any module in the repository. I thought this was a great idea, but we weren't quite sure about the design. So for now, it is available on CPAN in a separate distribution called Pinto-Action-Doc. Once the kinks have been worked out, I hope to have something like this in the Pinto core.
Andy's work is actually the first plugin for Pinto, and I'm very excited about that. Pinto was designed for extension, so you can create new commands just by writing two modules (one for the back-end implementation, and one for the command-line interface). The Pinto API isn't well documented yet, but I've been told that the code is very clean and the existing commands are easy to follow.
As time goes on, I hope to see a lot more plugins like this one. Kudos to Andy for blazing the trail.
After the first burst of rants ähem layout of my cody GUI DSL I call in lack for a catchy bling name : GCL there are still some important holes to fill. Because the issue is not only to save you from boilerplate, but also saving you from mistakes and bad quality layout.
For a few months Pavel has been organising Moscow.pm technical meetings in the office of mail.ru, the company in Moscow he works in. They managed to have two or three talks for every meeting. I think it was a good proof that Pavel was a good candidate for this position and he would bring a new wave to Moscow's Perl life.
I took the leadership in 2007 and was behind a number of Moscow.pm offline meetings, a big enough number of workshops, conferences and hackathons in several countries. Since 2007 our mailing list became de-facto the ExUSSR Perl mailing list. There were a few monger groups appeared in Russia after Moscow.pm relaunch in 2007. As I am no longer living (but not forever) in Moscow and cannot take part in most of its activities, I think we made a good change :-)
I wish the new leader all the best and would like to see newcomers to Perl who will like the language because of Moscow.pm members' work.