Text or Number

Joshua Goodall joshua at roughtrade.net
Sun Mar 28 18:42:19 CST 2004


On Mon, Mar 29, 2004 at 10:12:37AM +1000, Scott Penrose wrote:
> This give me an idea...
> 
> 	->set_byte(0, 12);
> 	->set_byte(0, chr(12));
> 	->set_byte(0, [0,0,0,0,1,1,0,0]);
> 
> should probably all work. That way if someone already has a bit array, 
> they can give that to me :-)

Just to pile on the OO, you could use container classes :)

	->set_byte(0, new Device::ParallelPort::Value(12));
	->set_byte(0, new Device::ParallelPort::Char(12));
	->set_byte(0, new Device::ParallelPort::BitArray(0,0,0,0,1,1,0,0));

Who says you can't do static types in Perl? :)  Every value wants to be
an object!*

J

* c.f. Ruby. Or Scalar::Properties.

-- 
Joshua Goodall                           "as modern as tomorrow afternoon"
joshua at roughtrade.net                                       - FW109



More information about the Melbourne-pm mailing list