develooper Front page | | Postings from October 2010

How to properly install Data Files

Thread Next
Shlomi Fish
October 18, 2010 04:16
How to properly install Data Files
Message ID:
Hi all,

After I released a new version of XML-Grammar-Fortune-Synd, I got a lot of 
error reports from the CPAN testers:

The problem is that the data file installed by XML-Grammar-Fortune (its 
dependency) are not available for testing:

So my question is: how can I install them properly? There's a repository for 
XML-Grammar-Fortune where you can see the Module-Build sub-class I used for 

Currently I have:

package XML::Grammar::Builder;

use strict;
use warnings;

use base 'Test::Run::Builder';

use File::Find;

our $VERSION = '0.0101';

sub new
    my $package = shift;
    my %args = @_;
    my @extradata_files;
    my $module_name = $args{'module_name'};
    $module_name =~ s{::}{-}g;

    my $filter_files_cb = sub {
        my $filename = $File::Find::name;
        if ((-f $filename) &&
            ($filename =~ /\.(?:mod|xslt|dtd|ent|cat|jpg|rng|xcf\.bz2)$/)
            push @extradata_files, $filename;
    find({ wanted => $filter_files_cb, no_chdir => 1}, "extradata");

    my $builder = $package->SUPER::new(
        extradata_files =>
            (map { $_ => $_ } @extradata_files)


    $builder->install_path()->{'extradata'} = 
                qw(data modules),

        'extradata_install_path' =>

    return $builder;

=begin excluded

    my $get_dest_extradata_cb = sub {
        my $fn = shift;

        # Trying if this makes it work.
        # TODO : Either remove this line or the rest of the lines.
        return $fn;

        $fn =~ s{^extradata}{data};
        return "lib/$module_name/$fn";

=end excluded




	Shlomi Fish

Shlomi Fish
Apple Inc. is Evil -

<rindolf> She's a hot chick. But she smokes.
<go|dfish> She can smoke as long as she's smokin'.

Please reply to list if it's a mailing list post - .

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About