I got dragged into an art project for helping out firefighting messaging between some small mipsel devices running linux.
The distribution comes with microperl in its package system, however it wasn't built with select() by default, which makes it pretty much useless for writing network applications. So I was hoping to cross-compile standard perl and modules to mips, but it seemed really painful. I gave up and ended up just enabling HAS_SELECT for the cross-compiled microperl.
Now I have to use Socket.pm to actually do the networking bit. It turned out lots of crucial bits are written in xs, so I reimplemented them in pure perl. (Ya, I know it's bad to pack platform-dependent structure manually)
So I have a tiny application controlling a local led display and buttons IO device, as well as broadcasting and processing events over network, all in a few hours after I get the microperl and socket working!
Anyway, it's quite fun hacking and I am looking forward to the show itself!
what fun -- embedded Perl! (Score:1)
Using MicroPerl for embedded is a great idea. Microperl, not just for bootstrapping anymore.
Bill
# I had a sig when sigs were cool
use Sig;
microperl & sockets (Score:1)
Re: (Score:1)
I finally could make it work by using the following code (that allows my code to be rather platform-independant, if I fill in properly the first bunch of variables):
my $PF_UNIX=1;
my $AF_UNIX=$PF_UNIX;
my $SOCK_STREAM=2; # 1 for ix86, 2 for MIPS
my $SOMAXCONN=128;
my $sun_path_SIZE=2;
my $sun_family_SIZE=108;
#my $uaddr = sockaddr_un($SOCKFILE); # Create a UNIX socket (local)... not used because this requires Socket.pm... instead, we will pack the sockaddr_un