tom arnall wrote:
[...]
why does '(m{0,1})' produce an empty scalar, while '(m){0,1}' an undefined
scalar?
and what i'm really after is to say:
($f,$g,$h)=/(a{0,1})(m|mn){0,1}(b{1,1})/;
and have $g come out a scalar which is defined.
Use the grouping syntax to group together m and mn like so:
($f,$g,$h)=/(a{0,1})((?:m|mn){0,1})(b{1,1})/;
(?:) groups without capturing.
$ man perlre
thanks,
You're welcome.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>