HDTenEightyP/NetNews huggingface dataset:
From: gweil@ibeam.intel.com (Garry Weil)
Subject: How to convert string to hex?
Organization: Multimedia Software Technology Group
Date: Mon, 25 Jan 1993 23:23:03 GMT

How do I convert "Test" to 0x54 0x65 0x73 0x74 ?

Garry
Newsgroups: comp.lang.perl
From: aas@rosmer.nr.no (Gisle Aas)
Subject: Re: How to convert string to hex?
Reply-To: Gisle.Aas@nr.no
Organization: Norwegian Computing Centre, Oslo, Norway
Date: Tue, 26 Jan 1993 08:35:56 GMT

In article <C1Fs2F.BB3@ibeam.intel.com> gweil@ibeam.intel.com (Garry Weil) writes:
>   >How do I convert "Test" to 0x54 0x65 0x73 0x74 ?
>
>   Is there something better?
>
>   BTW, I want to separate hex values with ",".

How about:
perl -e 'for (split(//,"Test")) {
             $a .= sprintf("0x%x,", ord)
         }
         chop $a; print $a'

or

#!/usr/local/bin/perl
while (<>) {
   chop;
   print join(',', grep($_="0x".$_,unpack("H2" x length, $_))), "\n";
}
--
Gisle Aas               |  snail: Boks 114 Blindern, N-0314 Oslo, Norway
Norsk Regnesentral      |  X.400: G=Gisle;S=Aas;O=nr;P=uninett;C=no
voice: +47-2-453561     |  inet:  Gisle.Aas@nr.no
From: rahard@eeserv.ee.umanitoba.ca (Budi Rahardjo)
Newsgroups: comp.lang.perl
Subject: Re: complete bugfree MS/DOS version 4.35
Date: 27 Jan 93 04:14:03 GMT
Organization: University of Manitoba, Winnipeg, Canada

Gertjan Koetsier <gertjan_koetsier@mentorg.com> writes:

>Is there an 4.35 version available that has no bugs or extra
>requirements (like
>an software 387 emulator). I would really like to find such a version
>cause I would
>like to explore the features of perl at home....

Try ftp.ee.umanitoba.ca (130.179.8.95) /pub/msdos/perl/*

-- budi rahardjo
--
Budi Rahardjo
<rahardj@ccu.umanitoba.ca>      <rahard@ee.umanitoba.ca> 
Electrical Engineering - University of Manitoba - Canada
Newsgroups: comp.lang.perl
From: ripper@athena.mit.edu
Subject: Editline in perl
Reply-To: ripper@athena.mit.edu
Organization: The Internet
Date: Tue, 26 Jan 1993 22:22:54 GMT


I'm trying to generate a prompt which would allow users many
of the spiffy lineeditting characteristics that tcsh has (^A to
goto beginning of line, ^K to kill the rest of the line, ^E to
get to the end of the line, arrow keys, etc).  Is there a script 
out there already that does that?  Is there also a better 
documented version of 'termcap.pl' (which has more than a header
of 4 short usage examples)?

-Ross Lippert
ripper@athena.mit.edu
Newsgroups: comp.lang.perl
From: ram@eiffel.com (Raphael Manfredi)
Newsgroups: comp.lang.perl
Subject: A simple test for perl 5.0
Summary: Bug report for perl 4.0 PL35
Keywords: bug
Date: 27 Jan 93 02:25:29 GMT
Organization: Interactive Software Engineering, Santa Barbara CA

Larry,

Please make sure the following does not dump core with perl 5.0 :-) :-)

--------------------------
&verify('a', 'b', 'c');

sub verify {
	local($a, $b, $c) = @_;
	local($deplist);
	local($dummy);
	print "In verify\n";
	($deplist, $dummy) = &explore($a, $b, $c);
}

sub explore {
	local($x, $y, $z) = @_;
	print "Calling verify\n";
	&verify($x, $y, $z);
}
--------------------------

With perl 4.0 PL35 on my MIPS, I get:

In verify
Calling verify
Memory fault - core dumped

Which is peculiar... Removing one of the 'local' declarations in 'verify'
on simply avoiding assignment of &explore() into an array makes the
program loop indefinitely, as expected.

Running this program under the debugger produces the expected results.

Here is the dbx stack:

dbx version 2.11
Copyright 1988, 1989 MIPS Computer Systems Inc.
Type 'help' for help.
Corefile produced from file "perl"
Child died at pc 0x4039cc of signal : Segmentation fault
reading symbolic information ...
[using memory image in core]
(dbx) where
>  0 savelist(sarg = 0x100236b4, maxsarg = 1) ["cmd.c":1163, 0x4039c8]
   1 do_subr(0x1, 0x7fff982c, 0x44b6a0, 0x0, 0x10023f68) ["doarg.c":1156, 0x40f848]
   2 eval.eval(0x1, 0x5, 0x3, 0x0, 0x0) ["eval.c":1283, 0x426070]
   3 cmd_exec(cmdparm = 0x10028a3c, gimme = 1, sp = 1) ["cmd.c":657, 0x4026f0]
   4 do_subr(0x1, 0x7fff9a44, 0x40360c, 0x0, 0x403628) ["doarg.c":1158, 0x40f864]
   5 eval.eval(0x1, 0x5, 0xffffffba, 0xd, 0x43b0b8) ["eval.c":1283, 0x426070]
   6 eval.eval(0x0, 0x1, 0x3, 0x0, 0x0) ["eval.c":163, 0x41ffe4]
   7 cmd_exec(cmdparm = 0x10027a94, gimme = 0, sp = -1) ["cmd.c":657, 0x4026f0]
   8 do_subr(0x0, 0x7fff9d54, 0x43b0b8, 0x100032f6, 0x43b0ec) ["doarg.c":1158, 0x40f864]
   9 eval.eval(0x0, 0x3, 0x10023f68, 0x0, 0x0) ["eval.c":1283, 0x426070]
  10 cmd_exec(cmdparm = 0x10027144, gimme = 0, sp = -1) ["cmd.c":657, 0x4026f0]
  11 .block5 ["perl.c":890, 0x43054c]
  12 main(argc = 0, argv = 0x7fff9f0c, env = 0x7fff9f10) ["perl.c":890, 0x43054c]
(dbx) quit

I think someone else reported a similar problem a long time ago. Everyone
had laughed at him (myself included, in a private mail), telling him to get
rid of the infinite recursion... However, this seems to be a serious problem.
-- 
Raphael Manfredi <ram@eiffel.com>
Interactive Software Engineering Inc.
270 Storke Road, Suite #7                      / Tel +1 (805) 685-1006 \
Goleta, California 93117, USA                  \ Fax +1 (805) 685-6869 /
From: stantz@sierra.corp.sgi.com (Mark Stantz)
Newsgroups: comp.lang.perl
Subject: Newbie question from an old hand: ?? vs //
Date: 24 Jan 93 01:19:10 GMT
Organization: Silicon Graphics, Inc.


	The Camel book says:

		?PATTERN?[i][o]

		This is just like the /PATTERN/ search, except that it matches
		only once between calls to the reset operator, so it finds the
		first occurrence of something rather than the last.

	Two years ago, I apparently misread this as:

		This is just like the /PATTERN/ search, except that it finds the
		first occurrence of something rather than the last.

	Consequently I would have expected the following program:

		#!/usr/local/bin/perl
		$f = "perl.is.great";

		$f =~ /\./;
		print "$` $'\n";
		$f =~ ?\.?;
		print "$` $'\n";

	to print:

		perl is.great
		perl.is great

	But instead I get:

		perl is.great
		perl is.great

	Okay, so I was confused.  What's the correct behavior?  Well, after
having read over the documentation for //, ?? and reset, I can't seem to make 
// and ?? do anything differently, and have decided that I don't really 
understand what the Camel book is trying to tell me.  Can someone post a code 
fragment that shows // and ?? doing different things?  Everything I've tried 
gives me the same behavior for both of them.  I've also checked the FAQ.

	-Mark
From: spaf@cs.purdue.edu (Gene Spafford)
Newsgroups: comp.lang.perl
Subject: Re: ftpget package - why doesn't it work ?
Date: 28 Jan 1993 18:37:42 -0500
Organization: Department of Computer Sciences, Purdue University
NNTP-Posting-Host: uther.cs.purdue.edu
In-reply-to: pete@smtl.demon.co.uk's message of Tue, 26 Jan 1993 11:18:08 +0000

Well, the problem may well be because of a bad assumption in chat2.pl

The error you are getting, 
	Unable to connect to gate.demon.co.uk ftp port: Connection timed out 
	at /usr/local/bin/ftpls line 48.
is because the "connect" call in chat'open_port is failing.

Take a look in chat2.pl, up near the beginning of the open_port
routine.   Does your version have a	
        $serverproc = pack($sockaddr, 2, $port, $serveraddr);
	unless (socket(S, 2, 1, 6)) {
		# XXX hardwired $AF_SOCKET, $SOCK_STREAM, 'tcp'
		# but who the heck would change these anyway? (:-)
in it?  If so, it could be that the assumptions Randal made when he
wrote that do *not* hold on your system.

Next, check the following places for define values:
  /usr/include/sys/socket.h
	AF_INET == 2   (mistyped as AF_SOCKET, as above)
	SOCK_STREAM == 1
  /usr/include/net/in.h
	IPPROTO_TCP == 6

If one of those defines is not as indicated above, then that explains
the problem.  It also is why each of the ftp packages would fail in a
similar way (using chat2), but system software (probably compiled with
the include files) would work.

To fix this means you should fix chat2.pl to use the correct values.
Note that if the AF_INET == 2 is at fault, it must be changed
in both the "pack" and "socket" calls.

If that is *not* the problem, then I'm at a loss to suggest anything
further to examine.
-- 
Gene Spafford, COAST Project Director
Software Engineering Research Center & Dept. of Computer Sciences
Purdue University, W. Lafayette IN 47907-1398
Internet:  spaf@cs.purdue.edu	phone:  (317) 494-7825
From: wumpus@spuddy.uucp (Jim Cheetham)
Newsgroups: comp.lang.perl
Subject: Scripting connection sessions?
Date: 20 Jan 93 13:33:35 GMT
Organization: Spuddy's Public Usenet Domain

I want to play around with automating connections to other machines,
over a cu connection (sorry TCP guys, it has to be!), and I wanted to
use perl because of what I want to do to the data ...

I'm familiar with "cu somewhere|" and "|cu somewhere" but I was
hoping for something like "+|cu somewhere" ..

(I'm on $RCSfile: perl.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:49:05 $
Patch level: 3 )

Anybody have any ideas for me, or places I can go to get examples?
-- 
       -jim, <wumpus@spuddy.uucp> or <!uunet!mcsun!uknet!spuddy!wumpus>
 * Meeeow ! Call Spuddy on (0203) 638780/638693 for FREE mail & Usenet access *
Newsgroups: comp.lang.perl
From: lytras@avalon.physik.unizh.ch (Apostolos Lytras)
Subject: Recognizing first letter in a string
Organization: Informatik Club Uni Zurich
Date: Thu, 28 Jan 1993 13:55:39 GMT

Hi,

I'd like to read addresses into a database which have been ocr'ed into
an ascii file. The format of an address is something like this:

(Dots are spaces, <cr> means carriage return.)

Foo.Bar.Bas,.Fooers<cr>
.....South Foo,4509...555.6666<cr>
.....East Foo Too,3...777.9999<cr>

And I'd like to get something like:

Foo.Bar.Bas,.Fooers,South.Foo,4509,555.6666<cr>
Foo.Bar.Bas,.Fooers,East.Foo.Too,3,777.9999<cr>

Like this I sometimes have to handle multiple addresses under one name, how
can I recognise whether a line begins with a space or with a letter?

Thanks for your help.
- Apostolos
-- 
Apostolos Lytras, Informatik Club der Uni Zuerich, Sys Admin
Internet: lytras@ifi.unizh.ch          |     lytras@avalon.physik.unizh.ch 
          lytras@amiga.physik.unizh.ch |        jab@ezinfo.vmsmail.ethz.ch
DECnet:   EZINFO::JAB                  |    PSI:      PSI%47931149412::JAB
Organization: Sponsored account, Chemical Engineering, Carnegie Mellon, Pittsburgh, PA
Newsgroups: comp.lang.perl
Date: Tue, 26 Jan 1993 11:11:53 -0500 
From: Tod McQuillin <tm8t+@andrew.cmu.edu>
Subject: Re: How to convert string to hex?
	<C1Fs2F.BB3@ibeam.intel.com>

gweil@ibeam.intel.com (Garry Weil) writes:
> gweil@ibeam.intel.com (Garry Weil) writes:
> 
> >How do I convert "Test" to 0x54 0x65 0x73 0x74 ?
> 
> BTW, I want to separate hex values with ",".

How about this:

$arg = $ARGV[0];
print join(", ", grep($_=sprintf("0x%x", ord $_), split(//, $arg))),"\n";

Works for me.
From: john@sekrit.WPI.EDU (John Stoffel)
Newsgroups: comp.lang.perl
Subject: Re: beginner's split question
Date: 28 Jan 93 21:49:00 GMT
Organization: Worcester Polytechnic Institute
NNTP-Posting-Host: sekrit.wpi.edu
In-reply-to: kenneths@ai.mit.edu's message of 28 Jan 93 18:36:16 GMT

>>>>> On 28 Jan 93 18:36:16 GMT, kenneths@ai.mit.edu (Kenneth J. Schneider) said:


Kenneth> if i want to split $_ into foo, what is wrong with:

Kenneth> 	$foo = split(/\./, $_);

One problem, $foo will have the number of items found with the split.
What I think you want is:

@foo = split(/\./o);

to print them out on individual lines do:

for (@foo) { print "$_\n"; }

Randall will now reduce the above line to a one character program.  *grin*

				John

--
Youth of today!  Join me in a mass rally for traditional mental attitudes!
-------------------------------------------------------------------------------
john@wpi.wpi.edu | Work Station Specialist | Worcester Polytechnic Institute
John Stoffel     | 508-831-5512 (work)     | Worcester, MA  01609
Newsgroups: comp.lang.perl
From: tbunce@cix.compulink.co.uk (Tim Bunce)
Subject: Memory allocation during @ary = <>;
Reply-To: tbunce@cix.compulink.co.uk
Date: Tue, 26 Jan 1993 21:59:00 +0000


While tinkering with a large script to improve it's performance
I started using trace(1) in the sun to watch the system calls.

The perl code reads in a large (>100k) text file, manipulates it,
then writes it all back out again. Using trace -c to count the system
calls I found:

     275 brk
     180 read
     161 write
     etc

The reads and writes are ok (perl does it's i/o in 4096 bytes blocks)
but 275 calls to brk (re malloc for those not familiar) seemed a little
excessive.

The following is an extract from the trace output (data shown as dots):
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 brk (0x276bb0) = 0
21:08:16 brk (0x279bb0) = 0
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 brk (0x27cbb0) = 0
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 brk (0x27fbb0) = 0
21:08:16 brk (0x282bb0) = 0
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 brk (0x285bb0) = 0
21:08:16 brk (0x288bb0) = 0
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 brk (0x28bbb0) = 0
21:08:16 brk (0x28fbb0) = 0
21:08:16 read (3, "..................................".., 4096) = 4096
21:08:16 brk (0x293bb0) = 0
etc etc

Notice that after a while perl is calling brk() for almost every read, Ouch!
I presume here that perl is calling malloc() and malloc() is calling brk()
because it has no spare memory.

I had hoped to improve performance by allocating lots of memory for a
temporary variable and then freeing that memory before the read. This
did not seem to affect the brk()'s, I presume the memory was not really
free()'d. (I've tried many ways to allocate and free the memory.)

Is there a better solution? Is there a way to change the read ahead size
from 4096? Given a virtual memory i/o system such as SunOS >4.1, a means
of setting a larger read size should be very beneficial. Perl 5 perhaps :-)

Regards,
Tim Bunce.
tbunce@cix.compulink.co.uk
From: mark@coombs.anu.edu.au (Mark)
Newsgroups: comp.lang.perl
Subject: Re: julian date conversions
Date: 23 Jan 93 15:12:59 GMT
Organization: Australian National University
NNTP-Posting-Host: 150.203.76.2
Organisation: Wassat?!

frankm@ying.CNA.TEK.COM (Frank 'Scruff' Miller) writes:

>How do I get a julian date into a regular date (like the 9
>element array returned by localtime()).

>If I can get this into time_t, I can do the rest (well, of course).

You will most likely find what you want in these...

coombs:~/mark/perl/scripts mark> grep date INDEX
date.pl        - print dates how you want with the sysv +FORMAT method
date.shar      - routines to manipulate and calculate dates
getdate.shar   - returns number of seconds since epoch for any given date
ptime.shar     - print dates how you want with the sysv +FORMAT method

These files are found in the anon ftp dir /pub/perl/scripts on
coombs.anu.edu.au [150.203.76.2]. See the README file in the /pub/perl dir for
usage details.

Hope this helps

Mark
mark@coombs.anu.edu.au
Newsgroups: comp.lang.perl
From: Gertjan Koetsier <gertjan_koetsier@mentorg.com>
Subject: complete bugfree MS/DOS version 4.35
X-Useragent: Nuntius v1.1.1d17
Date: Tue, 26 Jan 1993 07:49:35 GMT
X-Xxdate: Tue, 26 Jan 93 08:53:28 GMT
X-Xxmessage-Id: <A78AAC88D6014008@bvmac008.mentorg.com>
Organization: Mentor Graphics corporation

Is there an 4.35 version available that has no bugs or extra
requirements (like
an software 387 emulator). I would really like to find such a version
cause I would
like to explore the features of perl at home....

Thanks

***************************************
*  Gertjan Koetsier                   *
*  Telecom Consultant                 *
*  Mentor Graphics Corporation        *
***************************************
Newsgroups: comp.lang.perl
From: Alan Stebbens <aks%anywhere@hub.ucsb.edu>
Subject: Re: lists in associative arrays 
Reply-To: aks%anywhere@hub.ucsb.edu
Organization: The Internet
Date: Thu, 21 Jan 1993 17:33:18 GMT

| From: danq@spot.Colorado.EDU (Daniel Quinlan)
| ...I think there must be some better way to do this
| than ...
| 	$list{$i} = "$list{$i} new_entry" ; 

| From:    Tom Christiansen <tchrist@convex.COM>
| The ".=" operator would be a bit more efficient, I suspect.

The way I build lists is:

	$list .= $new.' ';

Then, when you're done, I either use 

	@items = split(' ',$list);

to ignore the trailing blanks when separating items, or to simply remove
the trailing blank:

	chop($list);

If you are building an array of accumulating lists:

	while (<>) {
	    ...
	    $list[$index] .= $new.' ';
	    ...
	}

You choose to either ignore the trailing blanks, or chop them:

	grep(chop,@list);


If you are building a associative array of accumulating lists:

	while (<>) {
	    ...
	    $list{$entry} .= $new.' ';
	    ...
	}

Simiarly, you can ignore the trailing blanks, chop them, or use split
(as Tom pointed out above) to ignore them.

	foreach $ent (keys %list) {
	    chop($list{$ent});
        }

-- Alan Stebbens, UCSB, Santa Barbara <aks@hub.ucsb.edu>
"If all you have is a hammer, then everything looks like a nail."

Newsgroups: comp.lang.perl
From: jfriedl@TUBBY.MACH.CS.CMU.EDU (Jeffrey Friedl)
Subject: Re: Editline in perl
Reply-To: jfriedl@cs.cmu.edu
Organization: Omron Corporation / Carnegie Mellon
Date: Wed, 27 Jan 1993 16:08:06 GMT

ripper@athena.mit.edu writes:
|> I'm trying to generate a prompt which would allow users many
|> of the spiffy lineeditting characteristics that tcsh has (^A to
|> goto beginning of line, ^K to kill the rest of the line, ^E to
|> get to the end of the line, arrow keys, etc).  Is there a script 
|> out there already that does that?

Several months ago I posted my 'readline.pl' package which provides
much of the same things as GNU readline, including horizontal scrolling,
command/file completion, rebinding, support for ".inputrc", undo,
history (with search), numeric prefixes, etc.

In addition (and as an option, because I like it but others might not),
it provides tcsh-compatable command/file completion.

Let me know if you'd like a copy but can't find it archived.

	*jeff*
-------------------------------------------------------------------------
Jeffrey Eric Francis Friedl   jfriedl@cs.cmu.edu -or- jfriedl@omron.co.jp
Omron Corporation, Section RZC, Shimokaiinji, Nagaokakyo Kyoto 617, Japan
Visiting researcher to the Mach Project, Carnegie Mellon University
Newsgroups: comp.lang.perl
From: graaff@dutiws.twi.tudelft.nl (Hans de Graaff)
Subject: Re: building Perl on Solaris 2.1 (again)
Organization: Delft University of Technology
Date: Sat, 23 Jan 1993 15:15:03 GMT

In article <1993Jan22.225755.16945@fwi.uva.nl> casper@fwi.uva.nl (Casper H.S. Dik) writes:
>eric@cray.com (Eric Markwardt) writes:
>>Anyway, can someone email me the hints/library combinations/etc. needed
>>to build Perl 4.035 on Solaris 2.1 with Sun C 2.0.1?  I have access to
>>gcc 2.3.3, too, if need be.
>>I've managed to get it to build with Sun C, but it core dumps in fdopen() 
>>when it tries to run the first test.
>
>Works fine for us, with the following problems:
>
>	- make sure that configure doesn't find/use any ucb stuff
This helps a lot with linking problems. The default (because of the
hints) is to include /usr/ucbinclude, but it's nog good.

>	- compile util.c w/o optimization
This makes sure that the above problem doesn't occur.
>	- use cppstdin or cc -E -Xs - or ...
>	  the #ident at the of other cpp output confuses perl.

Thanks, I still had this problem. Will try it later.

However, after compiling perl with the above corrections, perl still
failed one test (#18 in io/fs.t), which has to do with atime and
mtime. I guess the utime a few lines earlier is the culprit, but
before digging into this, has anybody else seen this, and more
importantly, fixed it?

Hans


-- 
Hans de Graaff                  | I want someone to follow,
J.J.deGraaff@IS.TWI.TUDelft.NL  |   who doesn't lead the way
Department of Informatics       | I want someone to listen,
Delft University of Technology  |   who won't repeat what I say
Newsgroups: comp.lang.perl
From: huober_j@xwini.rz.uni-ulm.de (Joachim Huober)
Subject: using syscall in perl 4.035
Keywords: syscall
Organization: Universitaet Ulm
Date: Thu, 21 Jan 1993 09:00:05 GMT

Hi

I would like to use sigblock() to block a signal.
I tried to use 

require 'syscall.ph';

$oldmask = syscall(&SYS_sigblock,$mask); 

$mask is a number.
The following happens:
if $mask is less 9 the signalmask ist set correctly.
Example $mask = 7 --> signalmask: (11101100)
				       ^^used by perl itself;
but if I set $mask greater or equal 10 then I get something confusing
Example $mask = 10 --> signalmask: (1000110000001100) :-(
I would expect to get signalmask: (01011100)
Does anyone know how I can set the korrekt signalmask?

				yours Joachim
Newsgroups: comp.lang.perl
From: ckd@eff.org (Christopher Davis)
Subject: Bug (or just lack of documentation) for unpack?
Organization: Electronic Frontier Foundation Tech Central
Date: Tue, 26 Jan 1993 21:49:03 GMT

unpack() appears to grab whole octets, even when using suboctet fields such
as B4 or H... this should probably be considered a bug, or be documented (I
couldn't find mention of it in either the camel book or the man page.

This is particularly annoying when trying to use HH to get two separate hex
digits from a single octet (can you tell I'm working on the unpack stuff
for the IP packet reader?  It was getting the version right, but coming up
with a zero for the header length, obviously broken...).

I've worked around it by H2'ing into a string and unpacking that, but
that's less than elegant.  (Similar problems are approaching if I want to
split out the TCP flag bits.)

Example:
ckd@loiosh ~ > uname -a
SunOS loiosh.ef 4.1.2 2 sun4c
ckd@loiosh ~ > perl -v

This is perl, version 4.0

$RCSfile: perl.c,v $$Revision: 4.0.1.7 $$Date: 92/06/08 14:50:39 $
Patch level: 35

Copyright (c) 1989, 1990, 1991, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 4.0 source kit.
ckd@loiosh ~ > perl -e 'print unpack("HH","d"),"\n"'
6
ckd@loiosh ~ > perl -e 'print unpack("H2","d"),"\n"'
64
--
 * Christopher Davis * <ckd@eff.org> * <ckd@kei.com> * [CKD1] * MIME * RIPEM *
Newsgroups: comp.lang.perl
From: bultman@sonny.unx.sas.com (David Bultman)
Subject: need help with remsh looping UNIX
Originator: bultman@sonny.unx.sas.com
Date: Thu, 28 Jan 1993 16:01:12 GMT
Organization: SAS Institute Inc.
Keywords: UNIX remsh infinite loop


I have a Perl program that surveys the available servers on
our LAN and by doing a remsh uptime determines which server
has the lowest load average. I use that server to run the 
next job on my job queue. Sometimes the remsh $server uptime hangs.
Is there a way to timeout with Perl? Here's what I have.

foreach (@stack) {
   $server = $_;
   chop($server);
   $rc = `remsh $server -n uptime`;  <- could hang here
#  Check to see if this is the lowest
#  and save if yes.
}




-- 
David Bultman, bultman@unx.sas.com	SAS Institute, Inc.
Core Research and Development		SAS Campus Dr, Cary, NC
(919) 677-8000 x6875			27513-2414 USA