Demonstrate subroutines in perl with a simple example.
Answer / Avnish Bharadwaj
Subroutines are functions in Perl. To define a subroutine, use the sub keyword.nnExample: `sub greet { print 'Hello, World!'; } greet();` This defines a subroutine called 'greet' and then calls it.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain the meaning of closure in perl.
What are the various advantages and disadvantages of perl?
Distinguish my and local?
Explain lists ?
Can inheritance be used in perl?
what is Perl one liner?
Mention how many ways you can express string in Perl?
What is the difference between module and package?
Explain what is the scalar data and scalar variables in Perl?
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur
How can you replace the characters from a string and save the number of replacements?
What are the different ways to run cgi?