On Thu, Mar 28, 2002 at 12:16:20AM +0000, Jonathan E. Paton wrote:
>
> I wanted the regular expression engine bump along
> the numbers... asserting that a number
> higher/lower didn't exist further along. Return
> as soon as that asssertion suceeds.
You can't with regular expressions. Of course, you could do trickery with
(?{}), (??{}) and s///e, but if you call that 'regular expressions', one
could call all C, Java, and Python "Perl" because it's linkable with XS,
or Inline:: stuff.
> 2. ...make it work in a more/less obfuscated
> way employing a minimum amount of regexs
Less obfuscated, and a minimum amount of regexes:
my $min = my $max = shift @array;
map {$max = $_ if $_ > $max;
$min = $_ if $_ < $min} @array;
Abigail