CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [death_metal] Error while creating code for inheritance: Edit Log



FishMonger
Veteran / Moderator

May 25, 2013, 10:35 AM


Views: 922
Re: [death_metal] Error while creating code for inheritance

What version of perl are you using? parent.pm was added to core in v5.10.1. If you're using an older version that would cause the "can't locate parent.pm in @INC" error.

Are both package definitions in the same file, or are they separate files?

You should have them in separate files, but if want them in the same file and you want to setup inheritance, then you need to use the -norequire option/param


Code
use parent -norequire 'lolol';


If you're using an older version, use base instead of parent.
http://perldoc.perl.org/base.html


(This post was edited by FishMonger on May 25, 2013, 10:39 AM)


Edit Log:
Post edited by FishMonger (Veteran) on May 25, 2013, 10:39 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives