I'm going to go over a bunch of the technical challenges that I faced building the Tabletop.Events, as well as some that are still yet to come. If you want to see what it takes to build a massive new app from scratch, talk about how to build a business around an app, or just learn about some novel solutions to hard problems, then join us at MadMongers on Tuesday, March 8th at 7pm.
Hey everyone,
Following is the p5p (Perl 5 Porters) mailing list summary for the past week. Enjoy!
[This is a post in my latest long-ass series.? You may want to begin at the beginning.? I do not promise that the next post in the series will be next week.? Just that I will eventually finish it, someday.? Unless I get hit by a bus.
IMPORTANT NOTE!? When I provide you links to code on GitHub, I’m giving you links to particular commits.? This allows me to show you the code as it was at the time the blog post was written and insures that the code references will make sense in the context of this post.? Just be aware that the latest version of the code may be very different.]
Last time I said that I had three things left to do for Date::Easy before it was ready for CPAN:
- Add a Time::ParseDate fallback to the ::Datetime class.
- Figure out how to handle the UTC version of datetimes.
- (Hopefully) fill out the POD.
This time, I’m reminded of the wise words of the great sage Meatloaf: two outta three ain’t bad.
By mauke
on
March 5, 2016 12:05 PM
We're all familiar with references and Use Rule 1:
You can always use an array reference, in curly braces, in place of the name of an array.
This leads to code like ${$foo} (dereference a scalar reference) or @{$bar{baz}} (dereference an array reference stored in a hash).
The curious part: The curly braces actually form a block, i.e. you can put multiple statements in there (just like do BLOCK), as long as the last one returns a reference:
% perl -E 'use strict; use warnings; ${say "hi"; \$_} = 42; say $_'
hi
42
This block also gets its own scope:
% perl -E 'use strict; use warnings; ${my $x = "hi"; say $x; \$x} = 42; say $x'
Global symbol "$x" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.
$x isn't visible outside the ${ ... } block it was declared in.
% perl -E 'use strict; use warnings; ${my $x = "hi"; say $x; \$x} = 42;'
hi
By DrForr
on
March 4, 2016 3:47 PM
Some sample text, this will be deleted later.
This is only of interest to Mac users who link their Perl against
MacPorts code, but if you are such a person, you may find this useful.
This morning I found that Perl code that used LWP::Protocol::https was
failing, but only when run by the test harness.
After some flailing around I managed to track this to the fact that I
had just updated MacPorts, and taken openssl from 1.0.2f_0 to 1.0.2g_0.
I still do not know the precise cause of the failure, but it was exposed
by the fact that the test harness (whether ExtUtils::MakeMaker or
Module::Build) set PERL_DL_NONLAZY=1.
Downgrading to the old openssl did not fix the problem of course, but
made the symptoms go away. The short version of the procedure is
$ sudo port activate openssl @1.0.2f_0
For details on downgrading a port, see https://trac.macports.org/wiki/howto/InstallingOlderPort
In my last YAML post I said libsyck is not maintained anymore.
I had a look, and this is wrong. Even if _why does not work on it anymore, (he came back btw recently), it is maintained and made some progress in libsyck, which is not reflected in the YAML::Syck perl part.
It is a mess, I admit, but easier fixable than the YAML::XS mess.
So I took libsyck upstream, which is at 0.70, and merged it with our changes which are at 0.61. Our perl-specific changes are a complete mess, so I cleaned that up to be acceptable upstream into a new 0.71.
merge back various changes from upstream (my own WIP version 0.71)
Personally I'd prefer YAML over JSON for local config data anytime.
Even if JSON is secure by default, and YAML is insecure.
YAML is readable and writable. It's better than .ini, .json and .xml.
But Houston we have a problem. For a long time. I'll fix it.
We have the unique advantage that the spec author and maintainer is
from the perl world, Ingy, and maintains the two standard libraries
YAML, the PP (pure perl) variant, and YAML::XS, the fast XS
variant, based on LibYAML.
This would be an advantage if those two libraries would agree on their
interpretation and implementation of the specs. They do not.
Historically the YAML library is used as the default reader for
CPAN .yml preferences and a fork of YAML::Tiny, CPAN::Meta::YAML which
is in core is used to read and write the package META.yml files.