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

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.

Replies are listed 'Best First'.
Ampersand now for something completely different.
by frankus (Priest) on Jul 24, 2002 at 13:10 UTC

       '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.

    ¤