Safe Travels

Though many are sticking around to take in all that Madison has to offer, many others are headed back home from YAPC::NA 2012.  Safe travels to you all.

[From the YAPC::NA Blog.]

Robert Blackwell said I should try Arduino

So I'm in Madison, Wisconsin for YAPC::NA 2012. Yesterday, I was supposed to meet up at one of the hackathons. I went to the Pyle building and searched the rooms and even accidentally went into brian's workshop (sorry brian!).

When I got to the hackathon room, it was pretty quiet but active. I had met Robert Blackwell two days prior at a dinner and had a lovely conversation and fun time with him. Robert had brought a ton of hardware (11 hours drive!!) and set up an entire room just so we could hack on hardware. Wait. Hardware?

At this point, I should probably mention I'm not a hardware guy. I can hook up the computer, change memory sticks, and I even replaced a CPU once - but that's pretty much it. Hardware is totally out of my league. I really don't understand it, nor was I ever really interested in it.

So I'm there and I just wanna sit and work on pointless boring stuff when Robert says "hey, how about trying Arduino?"

Webfusion sponsors YAPC::Europe 2012

Please welcome Webfusion as a silver sponsor of this years' YAPC::Europe.

webfusion_blog.png

Established in 1997, Webfusion is one of the UK's leading web hosting groups. We offer cost-effective, feature-rich hosting packages for everyone from businesses, web developers, designers and hobbyists. With 24/7 technical support, robust Firewall server protection and a state-of-the-art UK based data centre with Webfusion your website is always in safe hands.
www.webfusion.co.uk

How many of your dists are in Debian?

Here's a small script which I whipped up just now. I thought of trying out MetaCPAN::API, but after about 5 minutes of trying to find a way to list an author's distributions (and failed), I resorted to a quick hack using Mojo::DOM.

Here's a sample output:

YAPC:NA Day 3

YAPC::NA’s talks for Day 3 begin at 9am, with the plenary starting at 8:40am. Yesterday was a big success, but now it’s sort of sad that we’re already to day 3. Oh well, there’s always next year! Here’s to hoping that we go out with a bang in day 3.

Don’t forget that you can watch live on the web for free:

[From the YAPC::NA Blog.]

HTML-Tree 5: Now with weakref support

HTML-Tree has long been a source of memory leaks for programmers who weren’t very careful with it. Because it uses circular references, Perl’s reference-counting garbage collector can’t clean it up if you forget to call $tree->delete when you’re done. Perl added weak references (a.k.a. “weakrefs”) to resolve this problem, but HTML-Tree has never taken advantage of them. Until now.

HTML-Tree 5.00 (just released to CPAN) uses weak references by default. This means that when a tree goes out of scope, it gets deleted whether you called $tree->delete or not. This should eliminate memory leaks caused by HTML-Tree.

Unfortunately, it can also break code that was working. Even though that code probably leaked memory, that’s not a big problem with a short-running script. The one real-world example I’ve found so far is pQuery’s dom.t. In pQuery 0.08, it does:

open module under cursor in vim

Inspired by http://www.slideshare.net/c9s/perlhacksonvim I wrote (well ... copied for the larger part) a script to open the Module currently under the cursor in vim.

Typing \fm will lookup the first Module found in available Perl library paths (plus current working directoy . '/lib')

I did search for some time and read a bit about ctags and pltags but ended up confused. add this to your vimrc


""""""""""""""""""""""""""""""""""""
" find module in perl INC and edit "
""""""""""""""""""""""""""""""""""""
function! GetCursorModuleName()
    let cw = substitute( expand(""), '.\{-}\(\(\w\+\)\(::\w\+\)*\).*$', '\1', '' )
    return cw
endfunction

function! TranslateModuleName(n)
    return substitute( a:n, '::', '/', 'g' ) . '.pm'
endfunction

function! GetPerlLibPaths()
    let out = system('perl -e ''print join "\n", @INC''')
    let paths = split( out, "\n" )
    return paths
endfunction

function! FindModuleFileInPaths()
    let paths = [ 'lib' ] + GetPerlLibPaths()
    let fname = TranslateModuleName( GetCursorModuleName() )

    for p in paths
        let f = p . '/' . fname
        if filereadable(f)
            exec "edit " . f
            return 1
        endif
    endfor

    echo "File not found: " . fname
endfunction

nmap fm :call FindModuleFileInPaths()

CAVEATS


  • returns only the first found module
  • "local" modules not found unless current working directory has the lib/ dir as child

New CPAN Testers Sponsor: Webfusion

It is with great pleasure that we officially announce a new sponsor for the CPAN Testers Project. Webfusion have provided us with Managed Hosting, for us to use with some of the supporting websites. As such, we will be using it for the Analytics and Matrix websites, as well as a secondary failover site for the Static Reports site.

Webfusion are the latest corporate sponsor to support CPAN Testers. If your company would like to support CPAN Testers, please get in touch. You can also donate to the project via the CPAN Testers Fund, managed by the Enlightened Perl Organisation.

For further details, please see the CPAN Testers Blog.

YAPC::NA Day 2

Day 2 of YAPC::NA 2012 talks begin today at 9am sharp. The banquet was a huge success last night, and yesterday’s talks had the audience buzzing. Can’t wait to see what today brings. Hopefully you’re not all hung over from The Linode Beer Garden and the Perl Foundation party last night.

Don’t forget that you can watch live on the web for free:

[From the YAPC::NA Blog.]

Helping those who allow themselves to be helped

I cannot decide if I was too harsh. I try not to let the usual drone of noobs on SO to get to me. My problem was that the OP is being both ignorant AND demanding. Read the post and let me know, I'm back and forth between being enraged and contrite.

Perl sighting #2: aboutus.org

$ whois bonchon.com

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

...
=-=-=-=
Visit AboutUs.org for more information about bonchon.com
AboutUs: bonchon.com


Domain name: bonchon.com

Registrant Contact:
   BonChon
   Jinduk Seh ()
   
   Fax: 
   213 W 35th Street
   HASH(0x1030ba64)
   New York, New York 10001
   US

Administrative Contact:
   BonChon
   Jinduk Seh (bonchon@bonchon.com)
   +1.2122739797
   Fax: +1.2122739774
   213 W 35th Street
   HASH(0x1030ba64)
   New York, New York 10001
   US

Technical Contact:
   BonChon
   Jinduk Seh (bonchon@bonchon.com)
   +1.2122739797
   Fax: +1.2122739774
   213 W 35th Street
   HASH(0x1030ba64)
   New York, New York 10001
   US

Status: Locked

Name Servers:
   ns1.ipage.com
   ns2.ipage.com

...

Moo - almost, but not quite, two thirds of Moose

Matt S Trout will give a talk at YAPC::Europe 2012 described as

Moose is one of my favourite things to happen to perl in the last five years, but the startup overhead and additional dependencies can be hard to justify for very small projects.

So I asked myself ... "what's the smallest portion of Moose that I could
get by with, that would be easy to build so that when I load Moose my
classes can transparently upgrade themselves?".

The result is Moo - which provides most of the basic syntax of Moose -
and rather than trying to reinvent the MOP part, remembers enough to
make you a Moose::Meta::Class if you decide you need one later.

In this talk, I'll go over exactly which bits of Moose it provides, which
bits it doesn't (this list is longer :), why, and how it's built from
the ground up to be the right answer to "I want something smaller than Moose".

Have Lunch with a Perl Celebrity

From guest contributor brian d foy for YAPC::NA 2012

I’m setting up a decidedly low tech way to give newcomers special
access to Perl celebrities without the risk that their conversation
will be hijacked by all the other conference attendees who already
know that person. So far, I’ve convinced Sinan Ünür, Randal Schwartz
(merlyn), Ricardo Signes (rjbs), Karen Pauley, and Dave Rolsky to
participate. If you’d like to be one of the Celebrities for these
lunches, add your name to posterboard.

There will be a posterboard in the conference registration area
starting Wednesday morning. For each day, there will be some slots
where someone with the Celebrity’s name and a meeting time (and maybe
a food preference). Four people can put their name under the slot
they’d like to attend (and maybe we’ll add a waiting list). Meet back
at the posterboard at the chosen time and go to lunch at a place your
group chooses. That group gets an exclusive lunch and conversation with
the Perl Celebrity. Although I’m not requiring that the group cover
the lunch tab, it might be a nice gesture.

My only rule is that you should not have ever interacted with that
person, online, offline, IRL, or in any other way.

[From the YAPC::NA Blog.]

mod_perl 2.0.7 released with Perl 5.16 compatibility

I'm pleased to announce the release of mod_perl 2.0.7, available at
the following apache.org URL, along with a CPAN mirror near you
shortly, as well as http://perl.apache.org.

This release of mod_perl contains an update for perl 5.16, see the
change log below. Thanks to the code contributor and mod_perl dev team
members who made this quick release possible!

http://apache.org/dist/perl/mod_perl-2.0.7.tar.gz
http://apache.org/dist/perl/mod_perl-2.0.7.tar.gz.asc (pgp sig)

MD5 (mod_perl-2.0.7.tar.gz) = e8b3d7b6d67505a8e3050cb9042b944b


=item 2.0.7 June 5, 2012

Fix breakage caused by removal of PL_uid et al from perl 5.16.0. Patch from
rt.cpan.org #77129. [Zefram]

Mail::Audit and presuming a bit too much

I was tweaking my procmailrc today. My procmailrc recognizes a number of common pattern-based spam items and logs those into logs that I rotate on a regular basis. Anything else gets fed into a Mail::Audit-based "Sortmail" script. As I was testing a minor tweak, I noticed that the logfile for Sortmail (driven by the Mail::Audit object) wasn't getting any messages.

Long story short... I had opened the Mail::Audit logfile as "-", because I wanted it to use stdout, which in my procmailrc I had directed to the proper log.

But RJBS recently changed Mail::Audit from using the two-arg open for this name to the three-arg open for this name, and this was only apparent once I had used the CPAN diff tools (only in the source, and not documented, sadly).

Yes, I had created a 30MB logfile named "-" in my home directory. After carefully removing that file, and using an explicit filename for logfile, all was good.

But this is a heads-up for anyone else who might have presumed that "-" means stdout in Mail::Audit... you might be logging somewhere odd right now. :)

CPAN is all broken, now

I am not sure whose fault is, but Test::Pod now verifies for characters outside ASCII, and complains a missing =encoding directive. I like this check to be done, but I do not think that breaking half of the CPAN is a good idea. It would be better to just carp for the error, but not make it fail. This would give time to authors to fix their modules. In a later release, this could be a fatal error.

Now, we have Dancer, DBI and a lot of other modules broken, not installing cleanly from CPAN.

Where2GetIt is Hiring

Vegan / Vegetarian Food

Thanks to tinita! She started a Wiki page where you can find a list of restaurants that offer vegan / vegetarian food:

http://act.yapc.eu/ye2012/wiki?node=Food

BNF Grammars for SQL-92, -99 and -2003

Hi Folks

Back in 2005 I offered to host HTML and text versions of the BNF syntax for various SQL dialects, prepared by Jonathan Leffler.

He has just sent me updated versions of those docs, which are available on this page.

Cheers
Ron

Stealing from Python

We all know that Python, Perl and Ruby (ok, and PHP, and probably other languages) are always stealing ideas from one another. This is a nice thing to do.

After programming a few with Python there is a couple of details I like. I know not all are possible to implement in Perl. Some of them are, and I would love if they were. I know not all people agree with me (that good, too). Nevertheless, I present here a couple of ideas.

Although I do not like relying only in indentation for blocks, I like the fact that conditionals and loops does not need parenthesis. It makes the code much more legible. I imagine that to make this in Perl it would be crazy. Good enough we don't need them when using it as a modifier.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.