Home / Programming MCQs / Perl MCQs / Question
N
Q. What will be the output of the following Perl code?
use strict; use warnings; package vehicle; sub set_mileage{ my $class = shift; my $self = { 'distance'=> shift, 'petrol_consumed'=> shift }; bless $self, $class; return $self; } sub get_mileage{ my $self = shift; my $result = $self->{'distance'} / $self->{'petrol_consumed'}; print "$result\n"; } my $ob1 = vehicle -> set_mileage(2550, 175); $ob1->get_mileage();
No solution found for this question.
Add Solution and get +2 points.
You must be Logged in to update hint/solution
A group of statements that perform a specific task is known as ___.
What is a given-when statement in Perl?
Which of the following is a type of operator in Perl?
When you're pattern matching, you describe the pattern using
Which of the following is a valid assignment operator in Perl?
The creator of Perl programming language is ___.
Method overwriting can be used to implement run time polymorphism?
Discusssion
Login to discuss.