in reply to Parsing wtmpx in Solaris

Since it was hard won here is the same thing for HP-UX:
$template = "A8 A4 A12 l s s s s l A16 l"; # determine the size of a record $recordsize = length(pack($template,( ))); while (read(WTMP,$record,$recordsize)) { ($ut_user, $ut_id, $ut_line, $ut_pid, $ut_type, $ut_e_termination, $ +ut_e_exit, $ut_reserved1, $ut_time, $ut_host, $ut_addr) = unpack($tem +plate,$record); }

Of course the portable way to do this is with one of User::Utmp or Sys::Utmp :)

--
Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho