in reply to Re: All uppercase subs
in thread All uppercase subs

Because people don't like ugly names like that? Do read that section of the doc and see what kind of uses it is talking about. Some more recent names that have acquired special meaning: CHECK, UNTIE, CLONE, SCALAR, CLONE_SKIP.

Replies are listed 'Best First'.
Re^3: All uppercase subs
by tlm (Prior) on Jul 17, 2005 at 12:57 UTC

    Well, there's already ample precedent for "ugly names like that", such as __DATA__ and __PACKAGE__. Programmers need all the help they can get at the time of devising useful typographic conventions for identifiers, since the good alternatives are so few. One of these few good alternatives is the all-cap identifier, and I think it is a shame that the core has declared it off-limits.

    Update: Besides, the core can still reserve specific all-cap identifiers such as the one you list, just like it reserves any other specific keyword (if, else, for, etc.). My objection is to the blanket claim on all all-cap identifiers.

    the lowliest monk

      I think that the specially named subs deserve having beautiful names. OTOH I don't consider __DATA__ and __PACKAGE__ to be "ugly names" at all. They're nice as special tokens, and I must say I regret they (being supposed) not to be there in Perl6.

      As Larry himself wrote once, the shebang line

      #!/usr/bin/perl
      is much like a "hello!" and the
      __END__
      line is much like a "goodbye". Now IIRC it is supposed to be taken away in favour of a pod (or whatever it will eventaully be called) directive. But I mean: maybe it's just me, but I'm really keen on that "__END__".