http://www.perlmonks.org?node_id=1026838


in reply to How can one define value to call method "display" at line 45?

Your error happens because</c>

find_student($reg)

returns undef, which most likely means that no student matching $reg was found. Consider checking the values you have in your database and whether/how a student can be found given $reg.