Recently in Code craft Category

Perlbuzz news roundup for 2012-10-09

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Perlbuzz news roundup for 2012-10-01

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Perlbuzz news roundup for 2012-09-10

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Perlbuzz news roundup for 2012-04-30

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

  • In case you have a burning need to use ಠ_ಠ for warnings/errors: (metacpan.org)
  • Expanded the "More Tools" page of the ack website: (betterthangrep.com) Help your users by including alternatives for them to choose from!
  • YAPC::NA is NOT sold out. Still 30 tickets left. Sign up now! (blog.yapcna.org)
  • Before you send a patch, send an email (petdance.com)
  • For want of a newline (blogs.perl.org)
  • Use the command "perldoc -q whatever" to search the Perl FAQ for "whatever"
  • Perl 5.16.0 is coming soon, probably early May (rjbs.manxome.org)
  • Regexp::Common has regexes for just about everything. Check there first. (search.cpan.org)
  • Is Try::Tiny still the best choice for exception handling? (stackoverflow.com)
  • Using named regexes in ack output (stackoverflow.com)
  • Automating gov't websites w/WWW::Mechanize + HTML::DOM (blogs.perl.org)
  • Using Moose's "lazy" attribute for caching (blogs.perl.org)

Perlbuzz news roundup for 2012-04-23

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Perlbuzz news roundup for 2012-04-09

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

  • The Perl Unicode cookbook (perl.com)
  • bdfoy's got some ideas for code (blogs.perl.org)
  • How @rjbs spent his Perl QA Hackathon (rjbs.manxome.org)
  • The homepage for ack is completely redesigned. Hooray for open source, making up for my lack of design skillz. (betterthangrep.com)
  • Tricks to compiling mod_perl 2 to OS X Lion (blogs.perl.org)
  • Have you seen perl-reversion? (blogs.perl.org)
  • Using WWW::Mechanize and mech-dump to get my scratchy 45s (perlbuzz.com)
  • DBD::Firebird releases v1.0 (firebirdnews.org)
  • Recap of the Perl QA Hackathon (dagolden.com)
  • Reading about what people are working on = happy. (blogs.perl.org)
  • Whatever task you have, it's probably already on CPAN (blogs.perl.org)
  • The Perl Foundation wants to give you money to work on Perl (news.perlfoundation.org)
  • More niche modules, "incredibly useful for about 5 people on earth": (github.com)
  • Did you know prove has --shuffle to run tests in random order? Has randomizing tests uncovered bugs for you?
  • MetaCPAN has a new logo (perlnews.org)
  • RT @dukeleto This is a huge step forward in #perl dependency management: "carton bundle" support! (github.com)
  • RT @aaronlerch Some devs think "I'll just copy and paste this code block." Now you have two problems. Now you have two problems.
  • Would love to see this Perl::Critic talk (blogs.perl.org)
  • "The Python site talks about the value the reader gets out of Python, while the Perl site talks about Perl" (modernperlbooks.com)
  • How to get ahead in open source: Wear sunscreen. (blog.nerdchic.net)
  • Help Open Source Bridge select session proposals (plus.google.com)
  • MetaCPAN at the QA hackathon (blogs.perl.org)
  • Perl Foundation helps fund critical Perl 5 dev (news.perlfoundation.org)

New version of HTML::Lint validates HTML entities

| 1 Comment

I've released a beta of the new version of HTML::Lint, version 2.11_01. (At the time of this writing, this 2.11_01 release has not reached its search.cpan.org page yet) This version adds HTML entity checking to the tag checking that HTML::Lint has done since the dawn of time. If you're already using HTML::Lint, please help test this beta version!

Entity checking can be a messy business, but can be invaluable for finding little mistakes, especially in static HTML pages sent to you from other sources. For example, if I have this HTML file, filled with HTML entities and ampersands and all sorts of potential problems, HTML::Lint sniffs out the problems and reports them:

<html>
    <head>
        <title>Ace of &spades;: A tribute to Mot&oumlrhead. &#174; &metalhorns;</title>
        <script>
            function foo() {
                if ( 6 == 9 && 25 == 6 ) {
                    x = 14;
                }
            }
        </script>
    </head>
    <body bgcolor="white">
        <p>
        Thanks for visiting Ace of &#9824;
        <!-- Numeric version of &spades; -->
        <p>
        Ace of &#x2660; is your single source for
        everything related to Mot&ouml;rhead.
        <p>
        Here's an icon of my girlfriend Jenny: &#8675309;
        <!-- invalid because we cap at 65536 -->
        <p>
        And here's an icon of a deceased cow: &#xdeadbeef;
        <!-- Invalid because we cap at xFFFF -->
        <p>
        Another <i>deceased cow: &xdeadbeef;
        <!-- Not a valid hex entity, but unknown to our lookup tables -->
        <p>
        Here's an awesome link to
        <!-- here comes the ampersand in the YouTube URL! -->
        <a href="http://www.youtube.com/watch?v=8yLhA0ROGi4&feature=related">"You Better Swim"</a>
        from the SpongeBob movie.
        <!--
        Here in the safety of comments, we can put whatever &invalid; and &malformed entities we want, &
        nobody can stop us.  Except maybe Cheech & Chong.
        -->
    </body>
</html>


$ weblint motorhead.html
motorhead.html (3:9) Entity &ouml; is missing its closing semicolon
motorhead.html (3:9) Entity &oumlrhead. &#174; is unknown
motorhead.html (3:9) Entity &metalhorns; is unknown
motorhead.html (17:9) Entity &#8675309; is invalid
motorhead.html (19:9) Entity &#xdeadbeef; is invalid
motorhead.html (22:17) Entity &xdeadbeef; is unknown
motorhead.html (31:5) <i> at (22:17) is never closed

That last error about the unclosed <i> tag has always been part of HTML::Lint, but all the others are new with this version of HTML::Lint.

The HTML-Lint distribution includes the HTML::Lint module, which is object based for easy handling, and also includes Test::HTML::Lint so that you can add HTML validation to your test suites.

my $html = $app->generate_home_page();
html_ok( $html, 'Home page is valid HTML' );

If you're not doing any validation of your HTML in your apps, I suggest you give HTML::Lint a try.

Perlbuzz news roundup for 2012-03-12

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Perlbuzz news roundup for 2012-03-05

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Perlbuzz news roundup for 2012-02-13

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

« Business | Main Index | Archives | Community »