Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

  (email not shown publicly)
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Tuesday April 07, 2009
09:13 AM

Do They Compile?

[ #38767 ]

When you push more stuff into your compile time phase, it's great that compilation can warn you of serious problems. That's why when diddling with 'perl -pi.bak', I find variants of the following helpful:

$ ack '\$c->builder->add_main\(' lib/ -l|xargs perl -pi.bak -e 's/builder->add_main/add_to_builder/
$ for file in $(svn status |awk '/^M/ { print $2 }'); do perl -Ilib -c $file; done

Basically, did my global search/replace break my code? When your test suite takes well over an hour to run, this quick and dirty check is very useful.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • We have a test in the test suite at Dev/perl.t that runs perl -c and tests POD on everything.

    #!/usr/bin/perl -w

    use warnings;
    use strict;

    use Test::More;
    use Test::Pod;
    use File::Next;
    use App::Ack;

    use FindBin;

    my $startpath = $ENV{TTROOT} || '.';

    my $iter =
        File::Next::files( {
            descend_filter  => sub { $_ ne '.svn' && $_ ne 'tmp' },
        }, $startpath );

    my @files;

    while ( my $file = $iter->() ) {
        my @types = App::Ack::filetypes(



    • We have a virtually identical test. Takes four minutes to run. Hence the above snippet :)