Locale-TextDomain-OO-Extract

 view release on metacpan or  search on metacpan

lib/Locale/TextDomain/OO/Extract/Perl.pm  view on Meta::CPAN

            $_ eq '__END__'          ? do { $is_end = 1; q{} }
            : $is_end                ? ()
            : m{ \A [=] ( \w+ ) }xms ? (
                lc $1 eq 'cut'
                ? do { $is_pod = 0; q{} }
                : do { $is_pod = 1; q{} }
            )
            : $is_pod                ? q{}
            : $_;
        }
        split m{ \r? \n }xms, ${$content_ref};

    # replace heredoc's without killing the line number
    # <<'...'
    REPLACE: {
        ${$content_ref} =~ s{
            << \s* ' ( \w+ ) ' ( [^\n]* ) \n
            ( .*? )
            ^ \1 $
        }
        {

t/chars.t  view on Meta::CPAN

    {
        open my $file, '< :raw', $file_name
            or die "Cannnot open file $file_name";
        local $/ = ();
        my $text = <$file>;
        # repair last line without \n
        ok(
            ! ( $text =~ s{([^\x0D\x0A]) \z}{$1\x0D\x0A}xms ),
            "$file_name has newline at EOF",
        );
        @lines = split m{\x0A}, $text;
    }

    my $find_line_numbers = sub {
        my ($test_description, $test_reason, $regex, $regex_negation) = @_;
        my $line_number = 0;
        my @line_numbers = map {
            ++$line_number;
            ($regex_negation xor $_ =~ $regex)
            ? $line_number
            : ();



( run in 1.880 second using v1.01-cache-2.11-cpan-71847e10f99 )