What is the most appropriate way to invoke a subroutine that you've created?
Select one:
a. @mysubroutine;
b. invoke mySubroutine();
c. &mySubroutine;
d. start mySubroutine();
What is the most appropriate way to invoke a subroutine that you've created?
Answer: c. &mySubroutine;
The act of invoking a subroutine is called a subroutine invocation.
We use ampersand when calling a subroutine.
The following example defines a simple subroutine that displays a message.
sub
mySubroutine{ print "My new subroutine\n"; }
To call a subroutine, you use the following syntax:
&mySubroutine;
If you have any doubts, leave a comment below before rating. I'll be happy to assist you further.
Do UPVOTE this as I have put a lot of EFFORT in answering this question. It really helps me
Get Answers For Free
Most questions answered within 1 hours.