in reply to Re^5: Is it ok to mix functional and oo programming in one package?
in thread Is it ok to mix functional and oo programming in one package?
Be aware. If you don't deliberately arrange the code in a weird order, it works just fine. That is, if your modules are loaded before the code that uses them, as in you have use Your::Module;, or even just ensure that the modules are compiled before the code that uses them, then the problem does not arise:
#!/usr/bin/perl use warnings; use strict; package Foo; sub new { return bless {},shift; } sub hello { print "hello"; } package main; sub new { print "haha"; return; } my $a = new Foo; $a->hello; __END__ C:\test>junk2 hello
Just another example of the over-zealous promotion of a rare scenario, that by-the-by, provides clear and unambiguous diagnostics, into a "thou shalt not" that throws the baby out with the bath water. Just another justifiction.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Is it ok to mix functional and oo programming in one package?
by chromatic (Archbishop) on Oct 19, 2007 at 05:42 UTC | |
by BrowserUk (Patriarch) on Oct 19, 2007 at 11:30 UTC | |
by chromatic (Archbishop) on Oct 19, 2007 at 18:28 UTC | |
|
Re^7: Is it ok to mix functional and oo programming in one package?
by rhesa (Vicar) on Oct 19, 2007 at 01:30 UTC | |
by BrowserUk (Patriarch) on Oct 19, 2007 at 11:34 UTC |