You're writing Perl code in vim and have just typed a package name - maybe you
want to create an object of this class:
some_statement;
my $o = Some::Class->new;
do_something_with($o);
You obviously need to write use Some::Class at the top. So you either move
the cursor near the top and add the line, then jump to the previous line
number, or maybe you split the window, move to the new viewport, make the
change, then close that viewport.
As I promised, here are the slides from my talk this morning at Saint Perl-2 in Saint-Petersburg, Russia.
I believe Morpheus can be very useful for the community and hope that it'll become widely adopted.
There are still a lot of things which can be added, but conceptually we are on the right track.
These slides probably suck (I wrote them in the last moment and didn't put enough details in some places), but putting code out in the wild and getting feedback is more important by now.
One more thing, if you're going to check out PODs in next few days, see them on github instead of CPAN. There are much more of them added in 0.36 release, which is not uploaded to CPAN yet.
UPD: Just found out that 0.36 release docs can be viewed here: http://search.cpan.org/~mmcleric/Morpheus-0.36/
Morpheus::Key, Morpheus::Bootstrap and Morpheus::Plugin::Content PODs are worth to be looking at, if you are interested in implementation detals.
On Twitter, Curtis Poe (@OvidPerl)
posted some
interesting and unintuitive Perl code; I've slightly reformatted it and changed
some values for the sake of the following discussion.
use Data::Dumper;
sub boo { 4,5,6 }
my @x = ( boo() || 5,8,7);
print Dumper \@x;
What do you think this prints?
Let's look at some simpler examples of code:
$ perl -le'@x = (4,5,6,7,8); $y = @x; print $y'
5
An array like @x, in scalar context, evaluates to the number of elements in
that array. In this case, @x contains five elements.
By week i mean 7 days in which I touched the tablets.
Basically i just read the advent calendar and other sources and check if the tablets missing something. This way Appendix A has 25 entries more, much more revamped finding even keyword fossils of ancient Perl 6, not even known to moritz++, jnthn++ was helpful too. Also wrote the section about quoting and some minor parts of tablet 3.
Other than then I wrote last week an article for the next (10th) Perlzeitung about basics in Perl testung, because even beginners can't start too early with that. Since Perl's official Testing site lies pretty dormant I maybe take the brush to sweep there some things. but hej bigmouth I dont even got time follow properly p5doc and still in the starts for my thingy for the perl ecosystem group (still a seakrit). But my anger toward that subject rises. Any other volunteers for that out there?
Just another day at the office moving databases into MySQL. 10 lines of DBIx::Class::Schema::Loader make_schema_at() and I'm done. :)
Usually.
Unfortunately today the table names "Order" and "Service-tier2" blow up:
Bad table or view 'Order', ignoring: DBIx::Class::Schema::Loader::make_schema_at(): DBI Exception: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Order WHERE ( 1 = 0 )' at line 1 [for Statement "SELECT * FROM Order WHERE ( 1 = 0 )"] at refresh_schema.pl line 9
Apparently "Order" is semi-reserved by MySQL, and dashes are trouble:
SELECT * FROM Order # syntax error
SELECT * FROM `Order` # works
SELECT * FROM Service-tier2 # syntax error
SELECT * FROM `Service-tier2` # works
Another point for irc.perl.org #dbix-class, as ilmari pointed me to quote_char as the cure for what ailed me.
For a distribution that is built using Dist::Zilla, it is very easy to install all the dependencies:
dzil listdeps | cpanm
dzil listdeps will almost build the distribution so it can determine the prerequisites and then list them each on one line. This list can be passed directly to cpanm.
In my last post, I explained how to get an AnyEvent->timer to work in a Dancer application.
There’s nothing wrong with timers, but if you are using AnyEvent, you usually have to deal with CondVars. There are two things you can do with a CondVar: Either you register a callback which will be called when the CondVar is triggered, or you call recv and it will block until the CondVar is triggered. In a route of your Dancer application, you probably want to block until you got all the data you want to display to your user.
Take the following (made-up) example which uses a CondVar:
Our 2011 January meeting will feature Greg Lindahl speaking about blekko. Location forthcoming.
blekko is a new Web-scale search engine, offering focused searching using "slashtags", which enable you to restrict search results to the specific sites of actual interest. We'll use some open-source slashtags as examples. The rest of the talk will focus our implementation of the search engine and the underlying NoSQL database using Perl+XS, Map/Reduce done better, tuning Linux for good performance, etc.
Greg Lindahl is CTO at blekko. He was previously a founder at PathScale, where he was the architect of the InfiniPath low-latency InfiniBand HCA, used to build tightly-coupled supercomputing clusters. Prior to PathScale's founding in 2001, Greg worked on commodity Linux clusters at HPTi, including the 1999 Forecast Systems Lab system, which was the first time a Linux cluster won a conventional supercomputing procurement. Greg first used Perl before the Camel Book was written. Perl: the swiss army chainsaw of programming languages!
As we began working on iCPAN, we became aware of how problematic it can be to figure just exactly what is in the CPAN. More importantly, we became aware of things we really wanted to do when interacting with CPAN. Last month, Dave Rolsky posted some comments on a next generation CPAN search . He has a fairly extensive list of things which a CPAN search could offer and I'm more than inclined to think that he's on the right track.
A CPAN search site should:
be available to the wider community to clone, fork, patch, pull etc
let you upvote/downvote modules
have tighter integration with reviews, dependency reports etc
allow for complex searches
There are really so many things it could be. The problem, as I see it, is that this is too big a job for just one person and that may be where projects have stalled in the past.
The recent discussions about yacc made me
feel a bit like Lee Van Cleef in an old
spaghetti Western.
Cast alongside Clint Eastwood, Van Cleef watched
with great concern as one attempt after another
was made on Eastwood's life.
Van Cleef didn't mind Eastwood getting killed --
he just wanted to be the one to do it.