App-DataSectionSeekableUtils

 view release on metacpan or  search on metacpan

bin/dump-data-section-seekable  view on Meta::CPAN

        },
    },
};
sub dump_data_section_seekable {
    my %args = @_;

    my $path;
    if ($args{module}) {
        require Module::Path::More;
        $path = Module::Path::More::module_path(module => $args{module})
            or return [404, "No such module"];
    } else {
        $path = $args{file};
    }

    (-f $path) or return [404, "No such file"];
    open my($fh), "<", $path or return [500, "Can't open file '$path': $!"];

    my $found;
    while (<$fh>) {
        chomp;
        do {$found++; last} if /\A__DATA__\z/;
    }
    return [412, "No __DATA__ found in file"] unless $found;

    require Data::Section::Seekable::Reader;



( run in 0.431 second using v1.01-cache-2.11-cpan-39bf76dae61 )