What's the point you are trying to make here? This issue has nothing to do with global variables, and your only defense here is to not use named subroutines.
Well, I'm trying to have fun and learn something ;). Moreover, I was discussing about the opportunity to use named subroutines instead of global variables (I linked this thread in my OP as a start), so I suppose this has to do with global variables.
If you want to use a subroutine you should use a reference to an anonymous function.
I'm not able to contextualise this within the discussion. The whole point of using subroutines instead of plain variables is - ehr - not using plain variables. If I have to use anonymous functions, I'm probably obliged to use a variable to carry the reference.

My consideration was about using functions instead of global variables, and I do agree with you about the fact that the compiler will croak if we try to call them without using parentheses - something along the lines of use constant. On the other side, this would make it difficult (probably not impossible, but I'm no expert here) to use them as variables instead of constants (which is why you probably say that you can't always easily leave the parenthesis off I suppose).

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

In reply to Re^2: Global variables by polettix
in thread Global variables by polettix

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.