Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Possibly Stupid OOP question

by runrig (Abbot)
on Feb 27, 2008 at 00:32 UTC ( [id://670446]=note: print w/replies, xml ) Need Help??


in reply to Possibly Stupid OOP question

If it's all in the same source file, the STRTicket->new() should come last (preferably after a package main;).

Replies are listed 'Best First'.
Re^2: Possibly Stupid OOP question
by talwyn (Monk) on Feb 27, 2008 at 00:38 UTC
    ok ... if the package isn't declared ( top part of the code ) then its automagically in Main:: isn't it?

    If so, package ticket and STRTicket both follow package main. I generally like the core of my program at the top of the source file and refer to sub below. Until now it has always worked. Am I missing your point?

      @ISA = ... is just an assignment. It's not happening until AFTER your call to new(). So there is no inheritance until AFTER all of your packages. Perhaps putting each of the @ISA=...'s in BEGIN{...} blocks will work. (Maybe putting all of the packages in one big BEGIN {...} block will work? Update: Yes, it does seem to work).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://670446]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-03-28 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found