HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/perl5/Devscripts/Uscan/Ctype/perl.pm
package Devscripts::Uscan::Ctype::perl;

use strict;

use Moo;
use JSON;
use Devscripts::Uscan::Output;

has dir => (is => 'ro');
has pkg => (
    is      => 'rw',
    lazy    => 1,
    default => sub {
        $_[0]->{dir} . '/META.json';
    });

sub version {
    my ($self) = @_;
    return unless $self->dir and -d $self->dir;
    unless (-r $self->pkg) {
        uscan_warn "Unable to read $self->{pkg}, skipping current version";
        return;
    }
    my ($version, $content);
    {
        local $/ = undef;
        open my $f, $self->pkg;
        $content = <$f>;
        close $f;
    }
    eval { $version = decode_json($content)->{version}; };
    uscan_warn $@ if $@;
    return $version;
}

1;