in reply to Re^2: Is there an official regex for checking module names?
in thread Is there an official regex for checking module names?

I'm familiar with "::" but it wouldn't pass code review (cleverness reducing readability)

No, it's not being clever.

Do you write package main::Foo::Bar; or package Foo::Bar;? So why do you expect me to use %main:: instead of %::? If I want the root namespace, that's what I use. Not some alias created so you can say "scripts run in main".

Also, using Foo::->method instead of Foo->method solves a real problem. Again, not cleverness.

While "_a" probably wouldn't pass code review (non-meaningful name) it does match the pattern

oops! I saw the pattern for the lead character was shorter, and I somehow imagined that "_" wasn't included.

As already stated, non-ASCII names are disallowed ($work constraint).

That was not mentioned in the question. And you're not the only person using PerlMonks.

Replies are listed 'Best First'.
Re^4: Is there an official regex for checking module names?
by kcott (Archbishop) on Feb 09, 2022 at 02:28 UTC

    I believe you have taken my comment about "::" completely out of context. You wrote "package ::" which is very obscure — I actually don't think I've seen it previously — for $work, I'd expect "package main", which is common and generally understood.

    "So why do you expect me to use %main:: instead of %::?"

    I've no idea where that comes from. I did not voice such an expectation of you or anyone else.

    "Also, using Foo::->method ..."

    Again, I've no idea where that comes from; it wasn't mentioned in my post. In fact, I encourage the use of "::->" over just "->".

    "That was not mentioned in the question."

    My reply to you had "As mentioned, ...".

    "And you're not the only person using PerlMonks."

    Why write that?

    — Ken

      I've no idea where that comes from.

      You said using package :: wouldn't pass review. («I'm familiar with "::" but it wouldn't pass code review») So it means that %:: wouldn't pass review.

      Again, I've no idea where that comes from; it wasn't mentioned in my post.

      True, but you said :: and aaaa::::::bbbb wouldn't pass review, so I extrapolated that Foo:: wouldn't either.

      Why write that?

      The comment to which I replied assumed replies to your posts are only for your benefit.

      My reply to you had "As mentioned, ...".

      And I said that that this is irrelevant. Not everything is about you. You asked how to check if something is legitimate package name, and that was an important part of that.