Perl calling subroutine with leading '&' [duplicate]
问题 This question already has answers here : When should I use the & to call a Perl subroutine? (4 answers) Closed 5 years ago . Every now and then I see Perl scripts where subroutines are called with a leading '&'. Is this legacy, or does it give any benefit? As calling the subroutine without the ampersand sign works as well. sub mysub { print "mysub\n"; } mysub; &mysub; Thx/Hermann 回答1: Calling with & is generally a code smell that somebody doesn't know what they're doing and are in a Perl4