MCQs > IT & Programming > Perl > Which is the correct syntax of a subroutine that makes a positional parameter, say 'right', optional? (Assume the name of the subroutine as example, and left and right as the positional parameters.)

Perl MCQs

Which of the following is the correct syntax of a subroutine that makes a positional parameter, say 'right', optional? (Assume the name of the subroutine as example, and left and right as the positional parameters.)

Answer

Correct Answer:

sub example ($left, $right = 0) {

return $left + $right;


Explanation:

Note: This Question is unanswered, help us to find answer for this one

Perl Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Perl Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it