in reply to Re: Re: Re: Re: conditional match in regex
in thread conditional match in regex
Actually, $1 = type if the type is $, @, %, or *; however, in the <name> case, the only way to check its type is by nested conditionals outside the regex; something like:
if ($2) { if ($1 eq '$') { ... } elsif ($1 eq '@') { ... } ... } else { ... }
Which, IMHO, is a huge pain in the behind compared to a single if-elsif chain. Why do more work than you have to?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Re: Re: conditional match in regex
by petral (Curate) on Nov 06, 2002 at 14:58 UTC | |
by jryan (Vicar) on Nov 06, 2002 at 16:19 UTC | |
by petral (Curate) on Nov 06, 2002 at 16:46 UTC |