in reply to Re^3: Warning for "unused sub declarations"?
in thread Warning for "unused sub declarations"?

It seems to me that people are over-reacting here. I don't generally like to call subs with the ampersand because IMO the code is more readable without it, but honestly, if the other poster wants to write code that calls subroutines using ampersands and parens, I don't see how that will really harm him. Yeah, it suppresses prototypes, but so what? Nobody who needs to be pointed at perlsub is using prototypes anyway.

The only really weird wrinkle with the ampersand sigil is what happens if you also leave off the parens, but the other poster specifically said ampersand and parens, so he's not likely to run into that.


"In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68
  • Comment on Re: Warning for "unused sub declarations"?

Replies are listed 'Best First'.
Re^2: Warning for "unused sub declarations"?
by fishbot_v2 (Chaplain) on May 20, 2005 at 20:12 UTC

    How are we defining "really weird"? I think that this case is pretty weird, and happens with or without parens:

    use strict; sub foo(\@;@) { shift; print @_, "\n"; }; my @arr1 = ( [1, 2], 2, 3 ); my @arr2 = (1, 2, 3); foo( @arr1, @arr2 ); &foo( @arr1, @arr2 ); __END__ 123 23123

    I'll grant you that this example is tremendously cooked, but the issue is real. As you say, the OP might be unlikely to use such prototypes, but the OP is likely to be using the code of others.

      As noted upthread, people who have to be pointed to perlsub aren't even vaguely likely to be using prototypes.