|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Create a constructor named the same as your package name!by merlyn (Sage) |
| on Jul 01, 2004 at 12:47 UTC ( [id://371060]=CUFP: print w/replies, xml ) | Need Help?? |
|
Why type ->new? Have your package create a function so that the package name itself is the constructor! For example, you can have:
or Both are supported by the snippet code! Even works if ->new is inherited, and doesn't disturb any other class methods.
Back to
Cool Uses for Perl
|
|
||||||||||||||||||||||||||||||||||||||||||||