App-Transpierce

 view release on metacpan or  search on metacpan

bin/transpierce  view on Meta::CPAN

78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
sub read_config
{
        open my $fh, '<:encoding(UTF-8)', $config_filename
                or die "could not open $config_filename for reading: $!";
 
        if (!-d $working_directory) {
                mkdir $working_directory
                        or die "$working_directory did not exist, and couldn't be created: $!";
        }
 
        my $file_string = qr{ (["']) (?<str> .*) \g1 | (?<str> \S+) }x;
        my $perm_string = qr{ (?<chmod> 0[0-7]{3}) \s (?<chown> \S+) \s (?<chgrp> \S+) }x;
 
        my $context = undef;
        my @files;
 
        while (my $line = readline $fh) {
                if ($line =~ m{\A target \s+ $file_string}x) {
                        $context = $+{str};
                }
                elsif ($line =~ m{\A \s* (?: (new) \s+ $perm_string \s+ $file_string | $file_string ) \s* \z}x) {



( run in 0.282 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )