There is an error in the premise of your question, because this line:
$monitored_paths = {'svn/test-repo' => '/src/cpp', '/src/test', '/src/test2'}
is the equivalent of either of these:
$monitored_paths = {'svn/test-repo' => '/src/cpp', '/src/test' => '/src/test2'}
$monitored_paths = {'svn/test-repo', '/src/cpp', '/src/test', '/src/test2'}
What you really want is:
$monitored_paths = {'svn/test-repo' => ['/src/cpp', '/src/test', '/src/test2']}
where [] denotes an array reference. You create an array reference like this:
my $arrayref = [1, 2, 3]; # called an "anonymous array reference"
or like this:
my @array = (1, 2, 3);
my $arrayref = \@array;
You want something such as:
$monitored_paths = { '/svn/test-repo' => 'http://....list.txt' }
foreach my $key (keys %$monitored_paths) {
next if ref $monitored_paths{$key} eq 'ARRAY'; # skip if done already
my @paths = get_paths_from_url($key);
$monitored_paths->{$key} = \@paths; # replace URL with arrayref of paths
}
replacing get_paths_from_url with your URL-fetching and parsing function (using LWP or whatever...since that was not really part of your question I assume you already know how to do that). If you write your function get_paths_from_url to return an array reference in the first place instead of an array, you can save a step and write $monitored_paths->{$key} = get_paths_from_url($key) instead.