On Fri, Sep 10, 2010 at 1:13 PM, Paul LeoNerd Evans <leon...@leonerd.org.uk>wrote:
> On Thu, Sep 09, 2010 at 12:37:43PM -0700, Bill Ward wrote: > > Yes, but doing so is naughty. > > Really? Howso? > > I ask because I do it in a module of mine. > > > http://cpansearch.perl.org/src/PEVANS/IO-Async-0.29/lib/IO/Async/Listener.pm > > Namely: > > ----- > # This is a bit naughty but hopefully nobody will mind... > bless $handle, "IO::Socket" if ref( $handle ) eq "GLOB"; > ----- > > > Even in the comment you admit it's naughty :) but what I meant was taking an object of one type and reblessing it to another. GLOB isn't really an object (well that's debatable, but it's not from GLOB.pm!) so that's kind of a different thing.