in reply to pattern Matching

There's no match function in Perl.
There is a match operator.

$str =~ /test\/comp\/test1\/test2/

or better yet,

$str =~ m{test/comp/test1/test2}

You should have a look at perlre.