in reply to Class::MethodMaker, workplace politics, and patches
Yeah,yeah. I know. I suck!
#! perl -slw use strict; use Data::Dumper; package Foo; sub new { bless {}, $_[ 0 ] } package MyClass; use Class::MethodMaker [ scalar => [ { -type => 'Foo', -default_ctor => 'new' }, 'foo', ], ]; sub new { my $class = shift; bless {}, $class; } if( @ARGV and $Class::MethodMaker::VERSION eq '2.05' ) { no warnings 'redefine'; *MyClass::foo_isset = sub : method { package Class::MethodMaker::scalar; exists( $_[0]{foo} ); } } package main; my $m = MyClass->new; print $m->foo; $m->foo_reset; print $m->foo_isset ? 'foo is set' : 'foo is not set'; __END__ [19:57:31.35] P:\test>430184 Foo=HASH(0x225000) foo is set [19:57:33.20] P:\test>430184 patchit Foo=HASH(0x225000) foo is not set
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Class::MethodMaker, workplace politics, and patches (A dynamic patch)
by dragonchild (Archbishop) on Feb 11, 2005 at 20:17 UTC | |
|
Re^2: Class::MethodMaker, workplace politics, and patches (A dynamic patch)
by fluffy (Scribe) on Mar 13, 2005 at 12:29 UTC |