Question:

Which feature of Perl provides code reusability ? Give any example of that feature.

Answer:

Inheritance feature of Perl provides code reusability. In inheritance, the child class can use the methods and property of parent class

Package Parent;
 
Sub foo
 
{
 
print("Inside A::foo\n");
 
}
 
package Child;
 
@ISA = (Parent);
 
package main;
 
Child->foo();
 
Child->bar();

 


Keywords:

© 2017 QuizBucket.org