Hi,
I just hit something that I hadn't noticed before and I am not sure
it's it's a syntax issue or I have not been doing my reading.
I am trying to create a regex to match a directory name in path string
my $dir = dirname(shift);
(my $code) = ($dir =~ m|track.(\w{3}).|);
return $code;
I thought I'd use | as a delimiter rather than the more conventional /
. The regex without the 'm' gives an error:
syntax error at script/import.pl line ..., near "=~ |"
So this appears to be incorrect:
$dir =~ |track.(\w{3}).|
Is that right?
Also when you are using other delimiters, like |, do I no longer have
to stop escaping my slash charaters / but now need to escape my new
delimiting character EG |?
Thanx,
Dp.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/