There are three different formats to be used for calling the subroutines/methods, "hello" is the subroutine name, say
1) &hello; Subroutine definition can be made anywhere in the file. & is to tell compiler that, hello is a subroutine.
2) hello(); Subroutine definition can be made anywhere in the file. () is tell compiler that, hello is a subroutine.
3) hello; Subroutine definitions should be made before invocation If you have a subroutine definition after the invocation; at least you need to declare it with "sub hello;" before invocation. here sub is tell compiler that, there would be a subroutine named hello anywhere in the file.
&myvariable; It indicates 'myvariable' is a subroutine which is being called in the above statement .
Its mandatory to use & keyword before subroutine name only when userdefined subroutine name clashes with system defined subroutine . Ex: sub open{ print "file $_[0] is the file to openn"; }
What does the word '&myvariable' mean?what does the symbol '&' means? What's purpose of it?