local::lib is a great way of providing a contained set of Cpan modules for an application. But it can be awkward if you wish to use it to provide an updated File::Spec.
I wished to use Path::Tiny, which I installed using cpanm to a local::lib directory. That requires a newer version of File::Spec than came with the Perl we're using, so cpanm downloaded and installed that to the local::lib directory too, just as you'd want.
Our programs specify their local::lib directory, so they can be run by users without them having to fiddle around setting up environment variables (on Windows). Unfortunately, however, using it in our programs like this didn't work for Path::Tiny:
use local::lib qw<Cpan>;
use Path::Tiny;
That complains “File::Spec version 3.4 required--this is only version 3.33”.
For quite some months I was running after crazy potion and p2 testing problems, which looked like compiler or stack alignment problems.
potion, the vm for p2 uses tricky volatile words to force the compiler to put all GC-able data onto the stack, and not in registers so that the GC only needs to walk the stack to find all accessible data. No need to come to tricks like the boem-weiser libgc does to spill registers somewhere to be able to track them.
The second trick is to keep the stack properly aligned, at least 16 byte on darwin, but in case of SSE or AVX instructions or with double return values (e.g. atof) the alignment must be 32 byte.
But as is turned out the problem was not related to a missing volatile, which would have caused GC troubles, i.e. SIGBUS errors, nor stack alignment problems (i.e. random data corruption, esp. in the main interpreter).
I released GitPrep 1.3 at 2013/10/09. You can install portable GitHub system into Unix / Linux easily. It is second major release.
Because you can install GitPrep into your own server, you can create users and repositories without limit. You can use GitPrep freely because GitPrep is free software. You can also install GitPrep into shared rental server.
-Support Smart HTTP. You can do "git clone", "git fetch", "git pull" with high performance . And you can do "git push" via HTTP protocol. Authentication is Basic Authentication.
-Support Markdown syntax. If you put README.md, it is parsed as Mardown and displayed. and extension is ".md" file is also parsed as Markdown and displayed.
-Support submodule. Display link to submodule repository.
This version up have big advantage. You can do push and pull via HTTP by Smart HTTP support. This mean that you can complete all works only by normal GitPrep users, not gitprep user for SSH.
By this, we will do more good access controll in the future.
Imagine the following scenario. Something has gone wrong. It's Monday (of course it is), you're doing your best to find the underlying cause, yet a strange force is actively interfering -- you are required to provide a status update every 15 minutes.
Trouble is, you can't give much of an update. The best you can do is write something like
We're still trying to find the source of the problems, and a possible workaround.
A while later, after several variations of the above phrase have been posted, you transition to another state. Now, you can write
We have found the underlying cause, and we're working on fixing it.
Again, it's not much of an update, but it's something. Both phrases are general enough that some problems later, you start to wonder ,,Could I generate those updates automatically?''
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: