in reply to syscall() struct problem.

If you just want a subsecond sleep, there are two ways that don't involve syscall():

use Time::Hires; - that transforms the plain sleep call into a sleep call that understands fractions of seconds.

Use the four argument version of select as

select(undef, undef, undef, 0.25);

to sleep for 0.25 seconds

If you're bent on using syscall(), the pack (and unpack) function will become your best friends, as these allow you to create binary structures and pointers to them. pack has all about it.

Replies are listed 'Best First'.
Re^2: syscall() struct problem.
by bart (Canon) on Mar 29, 2006 at 20:42 UTC
    I'd just like to add this:

    The pack templates you're after are "p" and "P", which produce a pointer in a packed integer (much like "L").

    Make sure you don't change the scalar you're pointing to between pack and syscall, or that scalar might move, and the pointer will point somewhere invalid.