#!/usr/bin/perl -Wl use strict; my $my_domain = quotemeta 'http://www.localhost.net'; print for grep /^(?:$my_domain|\/)/, qw[ /sered/uplink /my/projects/ heh/reg http://www.OtherNetwork.org/network/ http://www.localhost.net/hello ];