in reply to grepping for

I think you are on the right path with your first example. You probably just need to strip the protocol and host information out of the URL first. You could use the URI module to parse the URL apart and reg-match on the path part.
use URI; my $dir='acm'; ...looping through the file ...$foo contains the URL from the logfile my $u=new URI($foo); if($u->path()=~/^\/$dir\//){ .. do stuff in here 'cause we got an "/acm/" line }
That probably isn't the fastest or most efficient way to do it, so you may want to tune the code if this is something that you will do often.