When I first saw ClassName::->new() proposed as a way to prevent ambiguous interpretation of ClassName->new(), it was shortly revealed that it didn't actually result in unambiguous parsing. It sounds like Perl's parsing may have been changed to improve that.

I'd actually rather more improvements be done so ClassName->new() is unambiguous [or at least generates a warning when it isn't unambiguously 'ClassName'->new()]. I'd much prefer to have to actually write (the first "()" in) Function()->new() when that is what I want. That turned out to be the sane thing for both $hash{BareWord} and BareWord => $value, despite it taking years to realize that.

For now, I'm not just yet going to run off and adopt the new fad considering the history of the many things in Perl that I've been told I should just stop using the old alternatives to, only to later find the new "must use" feature getting seriously down-graded, often out-right deprecated: v strings, pseudo hashes, base.pm, version.pm, Switch.pm, LVALUE subs, inside-out objects, source filters (actually, that last one became unpopular almost as soon as it became possible).

Then there are the things that I've already realized serious problems with that the broader community may eventually clue in to: using inheritance for things like Exporter / AutoLoader / DynaLoader, 'use warnings' in modules or in test suites, given/when, 'smart' match (it smarts!), { ... redo ... }, inheritance, my $x = shift, objects as glorified hashes, Moose, MooseX::Declare (wait, I already said "source filters"). I'm sure I'm leaving a few out. :)

But I'll keep it in mind. I appreciate the reminder of this potential pit-fall and the note about the compile-time warning.

- tye        


In reply to Re^6: MooseX obscure error and importance of Unit Testing (new tools) by tye
in thread MooseX obscure error and importance of Unit Testing by greengaroo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.