Beginning Perl - Sneak Peek
In my chapter on subroutines, I need to explain recursion. One example program I give draws mazes recursively. Here's a variation of the program, somewhat expanded beyond the book example.
In my chapter on subroutines, I need to explain recursion. One example program I give draws mazes recursively. Here's a variation of the program, somewhat expanded beyond the book example.
Guest poster brian d foy writes:
YAPC::NA is hosting a deathmatch that will finally settle the editor question, do you settle for vim or emacs when you are stubborn enough to not use something good. The advocates of either side are sure to point to the many ways they are able to modify their editor (probably using something that most people will agree is even uglier than Perl) so they can use weird, private incantations to do things that only work on their local system. You might notice these people wasting half a day setting up their inferior editor when they get a new system, or being unable to follow what they are doing in their primitive editors during their presentations.
How should a JSON parser handle character strings with non-ASCII characters? My humble opinion: fatal error. Here's what the JSON parsers on my machine did:
http://pastebin.com/mwui3iDy
My employer decided to opensource one of their internal tools: STF. STF is a distributed object store, much like MogileFS. The main difference is that STF uses HTTP (as opposed to a custom protocol) as its main protocol, uses components such as Apache/nginx, MySQL, memcached, Q4M/TheSchwartz. It's also new and therefore natively speaks PSGI internally, so you can use all your PSGI aware goodies. We also have an proof of concept setup to deploy STF on dotCloud platform.
Livedoor serves about 300 million objects (which means about 1.4 billion physical entities) using commodity hardware, running Apache 2.2 (+mod_reproxy), Memcached, MySQL 5.1, Q4M. Dispatchers are deployed on Plack + Starlet. We're also wrapping the application processes with Server::Starter for zero-downtime deployment (that means I can deploy to these heavily bombarded servers pretty much any time I want!)
Hello,
Fosdem 2012 will take place on 4 and 5 February.
You'll find our call for speakers here: Fosdem 2012 call for speakers
Hope to meet you there !
--
erik
As of now we have approved the list of talks for YAPC::NA 2012. You made it tough. We had 150 talks submitted, and only had room in the schedule for 95! So we had to make some tough choices.
If your talk was chosen you have until April 19th to confirm it on the site. If you do not confirm it by April 19th then your talk will be removed from the schedule, and a replacement talk will be scheduled. Likewise, if for any reason you no longer want to or cannot give the talk, please let us know.
If your talk was not chosen, fear not, there is still hope. Your best bet for getting your talk on the schedule is to convert it into a 5 minute lightening talk. There is room at the end of each day for 10+ lightening talks, and none of them have been scheduled yet. Also, some people will definitely drop out from the list that was chosen. When they do, a spot opens up for those talks that have been submitted but not chosen.
The YAPC::NA 2012 staff would like to thank you all for your talk submissions. You have ensured that we will have a spectacular conference in Madison this year!
[From the YAPC::NA Blog.]
No, really. This clown apparently thinks he can make money by stalking you online. The problem, as even he recognizes, is that you're able to prevent creeps like LOLchromatic from stalking you. The solution is that most people don't know that LOLchromatic and his ilk exist.
Was using an ubuntu virtual machine. Issued "ack" It said to install it using "sudo apt-get install ack". I did it. It didn't install App::Ack :( it is some other stupid tool. So, "sudo apt-get remove ack" followed by "sudo cpan App::Ack".
2011 is my most productive year yet in my "CPAN career": 495 releases (compared to 119 in 2010 and 54 in 2009). So far I have 115 distributions listed under my account (compared to around 15-20 in 2010, around 10 in 2009, and 2 before that). It really never occured to me that I would release over a hundred modules to CPAN, but all of a sudden I did. Perhaps next goal should be 1000 :)
Dist::Zilla helps a lot. I can't imagine doing manual tar and updating version numbers and README and all those distribution meta files manually for tens, let alone hundreds of releases. So thanks again to RJBS and other Dist::Zilla contributors!
Mark Fowler will be giving a talk at YAPC::NA 2012 described as:
This talk attempts to be the definitive guide to current state of exception handling in Perl
This talk will cover:
* The concept of exceptions and exception flow control
* throwing errors with die
*** The final newline oddity
*** autodie
* eval (it’s pronounced ‘try’)
*** The two forms of eval
*** Dealing with errors
*** How this sucks
* A note about %SIG handlers
*** CGI::Carp
* Throwing Blessed Objects
*** Rolling your own exception class
*** Handy exception object classes on the CPAN
* The DESTROY problem on legacy Perls
*** Why this problem occurs
*** How it’s solved on Perl 5.14 and later
*** Bad workarounds
*** Perl::Critic::Policy::ErrorHandling::RequireCheckingReturnValueOfEval
* Alternative syntax
*** Try::Tiny
*** TryCatch
[From the YAPC::NA Blog.]
Marpa::XS is now 1.000000. Marpa::XS is the current lead implementation of Marpa, an algorithm that I hope will become standard for those parsing problems which are too complex for regular expressions. Apparently quite a number of people have put the beta to use. Feedback has been positive -- often extremely so.
Marpa is a general BNF parser -- it parses anything you can write in BNF, no exceptions. Left-recursion, right-recursion, ambiguity and even infinite ambiguity, you name it, Marpa parses it. If the grammar is of a class in practical use, Marpa parses it in linear time -- O(n).
I'm trying to contact Jeff Kim about his Net::Amazon::EC2 module. I have a repo on github that closes most of the open tickets on RT for this module. I'd very much like to prepare and upload a new distribution to CPAN and close those RT tickets.
Jeff, if you see this please email me: mallen at cpan dot org.
Thanks.
The MetaCPAN logo contest is now in full swing, thanks in no small part to FLORA for his blood, sweat and tears in organizing it and also to the Enlightened Perl Organization, which fully funded this contest with astonishing speed.
Just to recap, the contest rules are posted at contest.metacpan.org and the entries are being posted at entries.contest.metacpan.org.
Now, you don't need to be a designer to get involved. Here are a couple of ways you can help out:
1) Get the word out. Let your designer friends know there is $400 up for grabs (not to mention eternal glory). If you're active on Twitter, please tweet about it as well. Send an email to your local PerlMongers group etc.
2) Comment on the entries. Because there is no limit on the number of entries per contestant, the logo submission process is allowed to be iterative. Constructive criticism can lead to authors resubmitting tweaked versions of their logos, which can only be good for the contest.
Lee Aylward will be giving a talk at YAPC::NA 2012 described as:
After investigating oEmbed, I came to the conclusion that oEmbed is a great idea, but difficult to use in practice. oEmbed providers are inconsistent and unreliable. So I built Noembed, a consistent oEmbed gateway to a large list of sites (many that don’t even support oEmbed themselves.)
Noembed was built using a mix of Plack and AnyEvent. It is used by us at Ars Technica, and will soon be used by a fairly popular Twitter client.
I’ll give a quick overview of the oEmbed spec, show some of the Noembed internals, and then do short demo.
[From the YAPC::NA Blog.]
Not nearly so exciting as my announcement of Zoidberg
, but today I announce the release of Tie::Array::CSV
version 0.04.
Tie::Array::CSV leverages Tie::File
and Text::CSV
to allow access to a CSV file as a native Perl 2D array (i.e. array of array references), without having to read the (entire) file into memory.
The major improvement in 0.04 was inspired by a conversation with David Mertens at the WindyCity.pm imformal meeting a couple weeks back. As I was explaining T::A::CSV to the group over a couple beers, David asked if the file is updated at every change. I said proudly that it was, however he noted that this has some drawbacks.
Dancer uses a simple model of interfacing with templating engines (based on
Dancer::Template::Abstract) and makes it very easy to add support for new
engines. Thanks to this, if you're not happy with the default simple
engine
or with Template Toolkit, there is now
a dozen different alternatives to choose from. Let's take a look at some of
them.
I've just published the first release of the here module, a mechanism for safely inserting generated code into a compiling program. this can be used to write macros, cut down on boiler plate, and to implement new declarations, all without ever having to parse any perl source code.
you operate on code as data, as you normally would when metaprogramming. then a call to use here $generated_code; injects that code into the compiling source
sub my_0 {map "my \$$_ = 0", @_} # a simple macro
use here my_0 qw(x y z);
results in perl compiling
my $x = 0; my $y = 0; my $z = 0;
and all of those variables are of course in scope after the use here line.
an example module using here is here::declare, which provides compile time assignment to lexical variables as well as a shortcut for defining constants.
use here::declare;
use my '@foo' => [1, 2, 3];
results in perl compiling
my @foo; BEGIN {@foo = (1, 2, 3)}
or to define a constant:
use const2 DEBUG => 1;
which results in:
sub DEBUG () {1} our $DEBUG; BEGIN {*DEBUG = \DEBUG}
giving you both the $DEBUG constant scalar, and the DEBUG constant subroutine with one simple declaration.
feedback welcome.
Breno de Oliveira will be giving a talk at YAPC::NA 2012 described as:
Tall and tan and young and lovely, the Brazilian Perl communities have grown a lot over the past decade and have a lot to share with other communities worldwide. Sadly, though, most of the time it feels like there are huge barriers between South America and North America/Europe. I hope to change that a bit now :)
In this talk I share a little about the Brazilian Perl communities’ past, present and future, and try to raise some awareness to the things we’re doing around these parts, and how we’re doing it.
Oh, and also invite everyone to visit us for some hacking by the beach, of course :)
[From the YAPC::NA Blog.]
By using the the grep
function in Perl, one can pick elements from a list that match a certain condition. Haskell uses the filter
function to do the same work.
When a solution has the same shape as the problem, it is a very good thing, and not just because it looks pretty. In previous posts, I have described Marpa::HTML, a Marpa-based, "Ruby Slippers" approach to parsing liberal and defective HTML. A major advantage of Marpa::HTML is that it looks like the problem it solves.
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.