in reply to Re: Regex to match ascending sequence
in thread Regex to match ascending sequence

Unfortunately, when I try this on my Perl 5.8, I get a panic: top_env message. I know that it doesn't have the //= operator.
  • Comment on Re^2: Regex to match ascending sequence

Replies are listed 'Best First'.
Re^3: Regex to match ascending sequence
by Laurent_R (Canon) on Oct 15, 2015 at 22:31 UTC
    $c //= $d;
    is just syntactic sugar for various constructs such as:
    $c = defined $c ? $c : $d;
    or
    $c = $d unless defined $c;
    Update: I've just quickly tried on an old VMS platform with Perl 5.8.6 with this regex definition:
    $regex = qr# (\d) (??{ my $c = $1 unless defined $c; ++$c })+ #x;
    it still does not seem to work.
Re^3: Regex to match ascending sequence
by LanX (Saint) on Oct 15, 2015 at 18:14 UTC
    The Defined-Or operator is best emulated with defined and or

    No idea about scopes in 5.8 , I remember 5.10 (or 5.12 ?) having an issue in this case.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Re^3: Regex to match ascending sequence
by Anonymous Monk on Oct 15, 2015 at 17:30 UTC
    Try  local our $c;

    Also, 5.8 is too old for experimental regex features

      The local our did not help. You are right about it being too old. Wish it was newer.