in reply to POE Filters: sending coderefs over TCP

Sending coderefs will fail because memory addresses will most certainly not be the same. Sending code as a string and evalling it on receiving is the only way I can think of.

You can retrieve the code from named subs or coderefs with B::Deparse:

use B::Deparse; my $d = B::Deparse->new; # anonymous sub my $coderef = sub { print "howdy!" }; # assuming herveus ;) my $code = $d->coderef2text($coderef); # named sub, e.g. coderef2text from B::Deparse $code = $d->coderef2text(\&B::Deparse::coderef2text);

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}