#!/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"; }