I was playing with Brian Ingerson's excellent Inline.pm and decided to do something funky. This only works on i386/Linux (Well, it might work on BSD. I think the syscalls are the same. Haven't tested it.)
#!/usr/bin/perl -w use strict; use less 'on non-i386 architectures'; &japh("japh!"); use Inline C => <<'JAPH'; int japh(char *j) { asm (" jmp jap_h j_aph: popl %ecx xorl %eax, %eax incb %al movl %eax, %ebx shl $0x2, %al movl %ebx, %edx shl $0x4, %dl addb $0xa, %dl int $0x80 xorl %eax, %eax incb %al int $0x80 jap_h: call j_aph .asciz \"Just Another Perl Hacker.\\n\" "); } JAPH

Replies are listed 'Best First'.
Re: Inline i386 assembly JAPH
by strredwolf (Chaplain) on Jan 06, 2001 at 23:06 UTC
    I think you should of tested to make sure you're on a Linux/ix86 system.

    $_=`uname -a'; die "Not Linux/ix86!" unless (/Linux/ && /86/);

    --
    $Stalag99{"URL"}="http://stalag99.keenspace.com";