in reply to Re: Interpolating in Here Documents?
in thread Interpolating in Here Documents?

What is wrong with the ampersand? The ampersand was not "killed", it hasn't even been deprecated! Just because you may leave off the ampersand doesn't mean you have to.

Some people prefer to use the ampersand, let them. (And yes, I know there's the difference if prototypes are used, or if the call is argumentless and parenless.)

Abigail

Replies are listed 'Best First'.
Re^2: Interpolating in Here Documents?
by tadman (Prior) on Jul 24, 2002 at 12:24 UTC
    What I mean is that the requirement to use an ampersand on function calls was removed with the introduction of Perl 5. It may be a minor point, it may not even be officially deprecated, but either way, I still plead my case: Say no to ampersands unless you know what you're doing. Virtually every time I see them, it's a case of someone using them out of ignorance, or because they are still dusting off some Perl 4-type code.

    Sure, some people prefer to use them, just I imagine some people prefer to use prototypes everywhere, despite how they can cause trouble. Perhaps some people even prefer to not use strict or warnings. These people are entitled to their opinions, of course.

    What's wrong with the ampersand? In this example, it is completely useless and serves no purpose.

         'Say no to ampersands unless you know what you're doing.'.

      Anyone who can write Eratosthene's Sieve in a one line regex, can be trusted to know what they're doing.

      Superficially, this is a question of programming style, far more pedantic than using map in a void context.

      In my opinion, prototypes have just as many pit-falls.
      I say 'don't use prototypes unless you know what you're doing.'.
      If someone else uses protos, read the code and use & wisely if you like.

      --

      Brother Frankus.

      ¤