$VAR1 = {
'regex' => {
'.*/home/members/index.htm.*' => {
'404' => {
'reporting' => '1000',
'paging' => '2000'
}
}
}
};
####
#!/usr/bin/env perl
use strict;
use warnings;
use JSON;
use Data::Dumper;
my $contents = `cat progconfig.json`;
my $config = JSON->new->decode($contents);
my $re = (keys %{$config->{regex}})[0];
print "re: $re\n";
my $path = '/some/fake/path/home/members/index.html';
if ( $path =~ /$re/ )
{
print "$path matched regex\n";
}
##
##
re: .*/home/members/index.htm.*
/some/fake/path/home/members/index.html matched regex