in reply to Re^4: 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?
Is there some way to do this:
#!/usr/bin/perl use warnings; use strict; use Foo; # some "forward declaration" syntax instead of looking for Fo +o.pm? sub new { print "haha"; return; } my $a = new Foo; $a->hello; package Foo; sub new { return bless {},shift; } sub hello { print "hello"; }
I couldn't find it under use in perlfunc. I was also trying use main::Foo; and use ::Foo; based on some ideas that popped into my head while reading about Packages in perlmod.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Is it ok to mix functional and oo programming in one package?
by Joost (Canon) on Oct 19, 2007 at 21:00 UTC |