in reply to Re^7: Capture a non-printable char and test what it is
in thread Capture a non-printable char and test what it is

I would never expect the "... && ... && ..." to be used in a real program.

Not in the form shown here. But maybe in some degenerated cases in generated code.

"# that's not perl: && ord($key) == 0o33"

Actually it is; however, it's very new. See "perl5340delta: New octal syntax 0oddddd".

Interesting. Redundant, as a leading zero already indicates octal since decades, no "o" required. And a nice complement to 0x and 0b.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^9: Capture a non-printable char and test what it is
by Don Coyote (Hermit) on May 26, 2022 at 11:38 UTC

    Hi afoken

    Imo, not completely redundant. The 0o377 form has the advantage that it is a string literal that we know perl will interpret as a number, however that happens to be implemented in scalars.

    Whereas for the reader initiate the 0377 form can be somewhat ambigious, especially when they are preceded with a leading reference operator performing a similar disambiguation that may ultimately lead to further potentially uneccessary investigation on the part of the unfortunately bewildered acolyte.


    0x16-0xA==0xCoyote