in reply to Re^6: 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?
Why's that? It works ;-)hello $a;
#!/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; } sub hello { print "Hi, $_[0]!"; } my $a = new Foo; hello $a; __END__ Hi, Foo=HASH(0x814bd48)!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Is it ok to mix functional and oo programming in one package?
by BrowserUk (Patriarch) on Oct 19, 2007 at 11:34 UTC |