Please show desired output from a simple input case. I worked from your problems statement of:"i'm trying to extract names from a string which are separated by dashes" rather than your code. I think split() is better here than regex().
#!/usr/bin/perl -w
use strict;
my $line = "this-is-aline-one-two";
foreach (split (/-/,$line))
{
print "$_\n";
}
__END__
PRINTS:
this
is
aline
one
two