HDTenEightyP/NetNews huggingface dataset:
From: merlyn@ora.com (Randal L. Schwartz)
Newsgroups: comp.lang.perl
Subject: Re: Thanks to all of you that bought camel books!
Date: 13 Dec 92 19:51:44 GMT
Article-I.D.: romulus.MERLYN.92Dec13115140
Organization: Stonehenge Consulting Services; Portland, Oregon, USA

In article <Bz7L34.3F0@ccu.umanitoba.ca> rahardj@ccu.umanitoba.ca (Budi Rahardjo) writes:
   How about "Learning Perl Video" ?  or "perl scripts/packages CD-ROM" ?
   I am serious.

There have been some preliminary discussions with the people at
O'Reilly about videotaping me teaching a class based on "Learning
Perl" and making that available.  I'm not sure I'm ready for *that*
much frontside-of-camera work yet. (I'm much more comfortable behind
the camera.)  But, yes, there's a potentital project there, and if
OR&A can make money at it, you can bet that they are open to talking
about it.

Many hundreds of Perl scripts are already available at a few anon-FTP
sites.  What more do you want regarding that?

(Coming soon... "Perl: the Motion Picture" :-)

print "Just another Perl [book] hacker,"
--
Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
merlyn@ora.com (semi-permanent) merlyn@reed.edu (for newsreading only)
factoid: "Portland, Oregon, home of the California Raisins and Lone-Star Beer!"
Newsgroups: comp.lang.perl
From: barnett@paintbrush.mcc.com (Jim Barnett)
Subject: Re: Perl 5 and Latin-1
Organization: MCC
	<1992Dec14.131621.8150@nntp.csl.sony.co.jp>
Date: Mon, 14 Dec 1992 19:07:28 GMT

In article <1992Dec14.131621.8150@nntp.csl.sony.co.jp> kono@csl.sony.co.jp (Shinji Kono) writes:


   Support for 8bit char and multi-byte code sounds very good. I heard
   there is a two byte char code version of perl for Japanese.

Could anyone point me to this version of Perl? We're doing a project
involving a large amount of Japanese text, and a 2-byte version would
be a big help. I've been able to trick the regexp matcher into doing
simple matches, but fancier things would be a problem.

- Jim 
Newsgroups: comp.lang.perl
From: jerbil@ultra.com (Joseph Beckenbach {Adapter Software Release Engr})
Subject: WANTED:  many-to-one stream multiplexer
Summary: Am I dreaming, or need I hack some C?
Organization: Ultra Network Technologies
Distribution: usa
Date: Wed, 16 Dec 92 18:05:29 GMT

	I thought I saw, many moons ago, a means for multiplexing several
streams onto one stream which could then be disentangled later.  I'm looking
to merge stdout and stderr from a child process into one stream which preserves
their relative time order.  This is to act as the head of a filter stream, and
later filter modules will filter out specific combinations of lines on both
streams, leaving all other output on those streams intact.
	If I remember correctly, the lines were distiguished by being labelled
with "STDOUT: " and "STDERR: " prepended to the appropriate stream from the
child process.

	Pointers to FTP archives okay, though if it's short I'm sure that the
other lurkers here would love to see what Perl can do.  Anyway, I dislike
reinventing a wheel which I think I've seen before.

		Joseph Beckenbach
-- 
----
Joseph Beckenbach	jerbil@ultra.com	408-922-0600 x246
	(speaking from, but not for, Ultra Network Technologies)
From: dansmith@Autodesk.COM (Daniel Smith)
Newsgroups: comp.lang.perl
Subject: Re: Perl-side globbing (was Re: Perl Shell...)
Date: 16 Dec 92 23:26:08 GMT
Organization: Autodesk Inc., Sausalito CA, USA

In <BzBvo6.96G@sran230.sra.co.jp> utashiro@sran230.sra.co.jp (Kazumasa Utashiro) writes:

> For your interest, here is my shell wildcard to regexp
> subroutine.  This version works only for a filename (not a
> path).  I wonder you call this simple or complex :-)

> sub wildcard {
>     local($_) = @_;
>     s#\\?.#$_ = $&; s/\\?([_0-9A-Za-z])/$1/ || /\\./ || s/[*]/.*/ ||
> 	s/[|]/\$|^/ || tr/?{,}[]\-/.(|)[]\-/ || s/./\\$&/; $_;#ge;
>     length($_) ? "^$_\$" : undef;
> }

	Geez! :-)  I suppose a good thing I can point out about the shell
that I posted is that it's good for interactively working out lines like
that above (or did you get that one right the first time? [1])  I can have
it running in one window, and bounce perlisms off of it, while working through
a script in another...  Thanks to the folks that sent me globbing ideas/code,
I hope to integrate them into SoftList, making it a lot more useable.

				Daniel

[1] if so, I bow and wave, and say "I'm not worthy!" a la Wayne's World
-- 
     Daniel Smith, Autodesk, Sausalito, California, (415) 332-2344 x 2580
	      Disclaimer: written by a highly caffeinated mammal
	    dansmith@autodesk.com            dansmith@well.sf.ca.us
From: jon@cas.org (Jon Vander Hill)
Subject: Re: programming challenge
Organization: Chemical Abstracts Service, Columbus, Ohio
	<1992Dec16.081836.1094@usage.csd.unsw.OZ.AU>
Date: Wed, 16 Dec 1992 15:55:34 GMT

>>>>> On Wed, 16 Dec 1992 08:18:36 GMT, cameron@spectrum.cs.unsw.oz.au (Cameron Simpson) said:

> gnb@baby.bby.com.au (Gregory N. Bond) writes:
> | If you are editing man pages, they probably contain things like
> | E^HE to make things bold, and _^HE (or E^H_, depending on your
> | nroff) to underline them.  Rather than stripping the ^Hs then
> | compressing the repeats, what about doing both at once:
> | 
> | 	perl -pi.bak -e 's/(.)\cH$1/$1/g;s/_\cH(.)/$1/g;' {files}
> | 
> | (NB: \b is word boundry in regexps! Use ^H instead!)

> Ugh. Unless I'm missing something basic, this will work (and I've used this
> script for years):

> 	#!/bin/sh
> 	#
> 	# Remove nroff-style underlining and overstriking.
> 	# Works for other stuff, too.
> 	#

> 	exec sed 's/.^H//g' ${1+"$@"}

> Thus,
> 	unbs man.out > man.text

> It starts up much faster than Perl. That ^H is a literal control-H, guys.

Back to perl:

perl -lpe 's/.^H//g' man.out >man.text

I see no noticable lag in startup time on my system.

Jon Vander Hill
jon@cas.org
From: mark@coombs.anu.edu.au (Mark)
Newsgroups: comp.lang.perl
Subject: udp support in 5.0?
Date: 19 Dec 92 14:21:02 GMT
Organization: Australian National University
NNTP-Posting-Host: 150.203.76.2
Keywords: puh leeeze?
Organisation: Wassat?!

Yo Larry, can I put in an informal request for udp support in perl 5 please?
Ive asked here as others might want to discuss what they would like in it.
Specifically the sendto and recvfrom calls would be nice. 
It's possible to kludge them at the moment but it would be a nice addition.

Thanks.

Mark,
Perl's bad boy, I keep her up all night and make her do immoral things.
(With all these uncles and godfathers I figure she should have some fun too :)
Newsgroups: comp.lang.perl
From: witr@rwwa.COM (Robert Withrow)
Subject: Re: programming challenge
Reply-To: witr@rwwa.com
Organization: R.W. Withrow Associates
Distribution: usa
Date: Thu, 17 Dec 1992 17:20:05 GMT

In article <2999@uswnvg.uswnvg.com>, tcking@uswnvg.com (Tim King) writes:
| Ugh, Ugh.  Unless ~I'm~ missing something basic, the 'col' utility is
| specifically for this purpose, 

Which was the whole point behind my comment about ``Goooofffyyyy''.  One
should understand the problem you are trying to solve before going out in
search of solutions...

-- 
 Robert Withrow, Tel: +1 617 598 4480, Fax: +1 617 598 4430, Net: witr@rwwa.COM
 R.W. Withrow Associates, 21 Railroad Ave, Swampscott MA 01907-1821 USA
Newsgroups: comp.lang.perl
From: scott@sctc.com (Scott Hammond)
Subject: function returning array cause of core dump?
Organization: SCTC
Date: Thu, 17 Dec 1992 04:12:47 GMT

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

The following script dumps core on a sun4 under sunos4.1.2

    #!/usr/local/bin/perl

    sub getrevid {
	print "getrevid\n";
	(0, "name", "3.1");
    }
    sub trythis
    {
	local($ok, $nm, $version);

	if ($cnt==3){ exit(1); }
	print "cnt= $cnt\n";

	# one
	($ok, $nm, $version)= &getrevid("");
	$cnt++;
	# two
	&trythis
    }

    print "res: @res\n";

    $cnt=0;
    &trythis


If I comment out the line following "one" or the line following "two",
the program will not dump core, so clearly it has something to do with
functions returning arrays within recursive functions.  Am I trying to
do something illegal? 

--
Scott Hammond
scott@sctc.com
Xref: sparky comp.lang.perl:7485 comp.unix.programmer:5726
From: mbeattie@black.ox.ac.uk (Malcolm Beattie)
Newsgroups: comp.lang.perl,comp.unix.programmer
Subject: Re: Get hostname from IP address
Date: 17 Dec 92 17:22:41 GMT
Organization: Oxford University Computing Service, 13 Banbury Rd, Oxford, U
Originator: mbeattie@black

In article <1992Dec16.015357.10437@hyphen.com> dwight@hyphen.com (Dwight Ernest) writes:
>tim@deakin.OZ.AU (Tim Cook) writes:
>
>>dejesus@archimedes.nwc.navy.mil (Francisco X DeJesus) writes:
>>>
>>> I'd like to find a utility I can call from the command-line with an
>>> internet IP address as an argument, and have it return to me the full
>>> hostname related to it. I've looked into the function gethostbyaddr()
>>> but haven't been able to work. I also remember reading about a name-
>>> resolver funtion nres_gethostbyaddr() (sp?), but can't find any
>>> references to it on my system. I'm running SunOS 4.1.2 on a Sparc.
>
>>There Is Always A Simple Perl Script That Will Do It (tm).
>
>>The enclosed Perl script will convert a DNS hostname to an IP address
>>or vice-versa.
>
>50+ lines of perl followed.  Simple?  (grin)  Took me about 15 mins to
>hack up both the C programs posted earlier.  How long did it take you
>to cook the perl?  Just curious.
>

It took me only a few minutes yesterday to come up with

perl -e 'print ((gethostbyaddr(pack("C4",split(/\./,shift)),2))[0]);'

which takes an argument of the form 1.2.3.4 and does
the lookup. I was going to post but aborted it because I
started to blather on about how I'd hard-coded AF_INET
as 2 and how you could require sys/socket.ph if you wanted
and how you could error check if you wanted...

Now someone wants quick and short hacks, I've got a good
enough excuse to post :-)




-- 
Malcolm Beattie <mbeattie@black.ox.ac.uk> | I'm not a kernel hacker
Oxford University Computing Services      | I'm a kernel hacker's mate
13 Banbury Road, Oxford, OX2 6NN (U.K.)   | And I'm only hacking kernels
Tel: +44 865 273232 Fax: +44 865 273275   | 'Cos the kernel hacker's late
Newsgroups: comp.lang.perl
From: chip@tct.com (Chip Salzenberg)
Subject: Re: Feature request for perl V
Date: Thu, 17 Dec 1992 22:39:40 GMT
Organization: TC Telemanagement, Clearwater, FL

According to merlyn@ora.com (Randal L. Schwartz):
>@line_numbers = grep($lines[$_] =~ /IN A/, $[ .. $#lines);

Wow.

Or if creation of the $[..$#lines array is a problem, perhaps:

  @line_numbers = ();
  $i = $[;
  for (@lines) {
    push(@line_numbers, $i) if /IN A/;
    ++$i;
  }

-- 
Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
  "you make me want to break the laws of time and space / you make me
   want to eat pork / you make me want to staple bagles to my face /
   and remove them with a pitchfork" -- Weird Al Yankovic, "You Make Me"
From: jon@cbl.umd.edu (Jonathan Kruger)
Newsgroups: comp.lang.perl
Subject: Trouble compiling perl-4.035 on ULTRIX 4.3
Date: 15 Dec 1992 11:57:16 -0500
Organization: University of Maryland, Chesapeake Biological Laboratory
NNTP-Posting-Host: cbl.umd.edu

I'm trying to compile perl 4.035 on a DECstation 5000/25.

It doesn't even come close to working.  I get a screen full of these
errors:

          CCCMD =  cc -c -DLANGUAGE_C -Olimit 2900 -Olimit 2900
ccom: Error: ./cmd.h, line 151: unknown size
       CSV * volatile curcsv  =  ((CSV*)0);
      ------------------------^
ccom: Error: ./cmd.h, line 151: unknown size
       CSV * volatile curcsv  =  ((CSV*)0);

I tried changing hints/ultrix_4.sh to say 4.3 instead of 4.2, but that
didn't help.  Any advice from someone who has this working?
From: mjeffery@reed.edu (Mark Jefferys)
Newsgroups: comp.lang.perl
Subject: In 5.0, are we gonna get...
Date: 14 Dec 92 04:38:35 GMT
Organization: Reed College, Portland, OR

Will we see:

1) an equivalent of lisp's mapcar?  For an instance:

	map(/(\d+)/, "asdf 23fjk4", "qwerty", "123 ")

   would return ("23", "4", "123").


2) a way of only matching the real beginning/end of a *string* in a
   regexp?  Currently, '^' and '$' match the beginning and ending of
   a line (with simplifying assumptions when $* == 0).  A string match
   would ignore newlines and $*.

   A new option on pattern matches might do it:  `/^\d+$/s' might match
   "23", but not "23\n" or "x\n45".  The option should treat `.' as
   matching "\n", as well as every other character -- so the option
   means that "\n" should not be treated specially. 


3) a pure grouping operator in pattern matches.  Normally, `/Type:
   (\d+|[a-zA-Z])/' will return an element containing the
   `\d+|[a-zA-Z]' (in an array context), and assign $1 to the pattern.
   If this isn't wanted, it will only slow perl down, and possibly
   make life confusing if the pattern is very complex.  One that
   doesn't try to save its contents would be nice.


Mark
-- 
Mark Jefferys		Internet: mjeffery@reed.edu
Newsgroups: comp.lang.perl
From: cameron@spectrum.cs.unsw.oz.au (Cameron Simpson)
Subject: Possible fix for: Trouble compiling perl-4.035 on ULTRIX 4.3
Reply-To: cameron@spectrum.cs.unsw.oz.au (Cameron Simpson)
Organization: CS&E Computing Facility, Uni Of NSW, Oz
Date: Thu, 17 Dec 1992 05:08:55 GMT

In article <1gl2pcINNa5@cbl.umd.edu> jon@cbl.umd.edu (Jonathan Kruger) writes:
| I'm trying to compile perl 4.035 on a DECstation 5000/25.
| 
| It doesn't even come close to working.  I get a screen full of these
| errors:
| 
|           CCCMD =  cc -c -DLANGUAGE_C -Olimit 2900 -Olimit 2900
| ccom: Error: ./cmd.h, line 151: unknown size
|        CSV * volatile curcsv  =  ((CSV*)0);
|       ------------------------^
| ccom: Error: ./cmd.h, line 151: unknown size
|        CSV * volatile curcsv  =  ((CSV*)0);
| 
| I tried changing hints/ultrix_4.sh to say 4.3 instead of 4.2, but that
| didn't help.  Any advice from someone who has this working?

Hmm, it compiled fine for me (on Ultrix 4.2A), but I have a guess at a fix.

CVS is a typedef for struct callsave, and is defined in perl.h.
struct callsave is defined in cmd.h.

Now supposedly you can use a pointer to struct before the struct itself is
declared, you just can't use its members. Obviously your compiler doesn't.

So, moving down to line 153 we find the definition for struct callsave.
Try moving it to just below the definition for struct cmd, before line 151.

Lemme know if it works. And mail it to Larry (lwall@netlabs.com).
	- Cameron Simpson
	  cameron@cs.unsw.oz.au, DoD 0743
--
"The engine purrs beneath me with a purpose,
 ready for the pleasure of my hand upon the throttle." - Peter Smith
Newsgroups: comp.lang.perl
From: ej@id.dth.dk (Erik Johansen (EMP))
Subject: Re: In search of good idioms.
Organization: Department of Computer Science
Date: Thu, 17 Dec 1992 09:48:06 GMT

claird@NeoSoft.com (Cameron Laird) writes:

>I'm a newbie perl-plucker.  I'm working through some
>exercises I've set myself, in an effort to develop
>some taste in matters of perl style.  Current problem:
>write a permute program.  Such a program would, for
>example, when presented with input

>	permute a1 zebra third

>generate output something like

>	a1 zebra third
>	a1 third zebra
>	zebra a1 third
>	zebra third a1
>	third a1 zebra
>	third zebra a1

Sure, I wrote a piece of code that should do that:

------- Cut here --------
#!/usr/local/bin/perl
print "Permuting (", join(" ", @ARGV), ")\n";

# Count first down by one so we don't skip first solution
$index[ $pos = $#ARGV ]--;   # So @index is (0,0,0..., -1)

permutation:
 while ( $pos >= 0 )
  {
   $index[$pos--] = 0, next  if ++$index[ $pos ] > $#ARGV;

   undef @used;  # Check to see if number occurs twice, then loop
   foreach $idx ( @index )
    { $pos = $#ARGV, next permutation  if $used[ $idx ]++; }

   print join(" ", @ARGV[ @index ]), "\n";
   $pos = $#ARGV;
  }
------- Cut here --------

I tried it out and it gives the output you requested.


  Hope this helps
  Erik Johansen

---
    $txt=" ltrterhnuc--sor eep-\nkJ.a "; srand(53747414);
    for (1..26) { print substr($txt,rand 27,1); }  ### Is this a random write ?

Erik Johansen / Institute for Computer Science / Danish Technical University
ej@id.dth.dk
Newsgroups: comp.lang.perl
From: jsparkes@bcars68a.bnr.ca (Jeff Sparkes)
Subject: Re: unpack and shift idiom?
Organization: Bell-Northern Research Ltd., Ottawa
Date: Fri, 18 Dec 1992 18:51:43 GMT

In article <1992Dec16.180058.15351@bcars6a8.bnr.ca> jsparkes@bcars68a.bnr.ca (Jeff Sparkes) writes:
>I'm reading binary data from a network stream.  I've accumulated the data in
>a variable called $data, and am taking it apart in chunks.  The code
>looks like:
>	@output = unpack("L4S6", $data);
>	$data = substr($data, 28);
>	@names = unpack("A20", $data);
>	???
>
>I'm concerned by the need to use a constant as the arg to substr, especially
>since I calculated it wrong the first time, and it took me a while to find.
>This gets especially hairy when I pull strings out of the data stream, since
>I don't know how many bytes to skip after unpacking A strings because some
>stripping occurs.
>
>Please tell me I'm missing something!

Well, one thing that I'm missing is that unpack works with fixed size
structures, and expects strings to be fixed length.  (I thought the number
was how many strings to read, not the legnth of the string.  I should learn
to read documenation properly!) Anyway, I was dealing with structures like:
	struct junk {
		long one, two;
		short three, four;
		char *s1;
		char *s2;
	}
which it seems perl it not well suited for.

One wish though:  it would be great if unpack would actually remove the
bytes from the front of the string, or at least provide some way to find
out how many bytes were used in the unpacking.

Oh well, live and learn.

--
--
Jeff Sparkes jsparkes@bnr.ca	Bell-Northern Research, Ottawa (613)765-2503
You know, a muffin can be *very* filling.
From: pyrros@braindamaged.cis.udel.edu (Christos T. Pyrros)
Newsgroups: comp.lang.perl
Subject: Error:  Allocation to large in Perl for DOS -- bug?
Date: 11 Dec 92 19:17:56 GMT
Article-I.D.: udel.1992Dec11.191756.16339
Organization: University of Delaware, Newark

When running the program below, I'm getting the following error:

Allocation to large: 11fe6

This error occurs on binary files that are over 200k or so.  The binary
files are AutoCAD Release 12 plot files for CalComp plotters.  Strangely,
this problem does NOT occur on AutoCAD Release 11 plot files, which are
slightly different.

Here is the program:

$absoutfile="c:\\tmp\\tmp.cdl";
$absinfile="c:\\tmp\\120.plt";

print "\nGenerating $absoutfile from $absinfile...\n";

open(NEWFILE,">$absoutfile") || die "Can't write to $absoutfile!\n";
open(REALFILE,"$absinfile") || die "Can't read file $absinfile!\n";

while(<REALFILE>)
{
	if (!//) {next;}
	print NEWFILE;
}
close(NEWFILE);


I'm using DOS 5.0 (mem reports 565k avail), and perl for DOS:


This is perl, version 4.0

$RCSfile: perl.c,v $$Revision: 4.0.1.6 $$Date: 91/11/11 16:38:45 $
Patch level: 19

Copyright (c) 1989, 1990, 1991, Larry Wall
MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis
V1.5 Borland C++ & VROOM port Copyright (c) 1992, Stuart Phillips


Is this a bug?  Or am I doing something wrong?

Thank you,

Chris
From: Rick Emerson <rick@ssg.com>
Subject: SUMMARY: File age - how?
Reply-To: rick@ssg.com
Organization: The Internet
Date: Tue, 15 Dec 1992 19:10:50 GMT

Sorry for the wasted bandwidth.  Instead of trying to get -M or -C to do the
job, I should have looked at stat().  [9] of stat()'s results fed to
ctime.pl works like a champ.  I hacked a version of ctime.pl to return only
the date and not the time but that's a minor item just for this application.  

Rick


| Richard B. Emerson     | Replies may be sent to:                         |
| System Support Group   |                        rick@ssg.com             |
| 940 Delaware Avenue    |-------------------------------------------------+
| Lansdale, PA 19446 USA | "When you ski, you dance with the mountain --   |
| Voice: 215.855.1607    |  and the mountain always leads."                |
Newsgroups: comp.lang.perl
From: lwall@netlabs.com (Larry Wall)
Subject: Re: Thanks to all of you that bought camel books!
Organization: NetLabs, Inc.
Date: Thu, 17 Dec 1992 18:22:46 GMT

In article <1992Dec16.160615.2054@cognos.com> alanm@cognos.com (Alan Myrvold) writes:
: Plus, how long will Learning Perl exist before it is obsoleted by version 5
: changes?

The intent of Learning Perl is to teach a useful subset of Perl, and
the intent of Perl 5 is not to remove the parts that people find useful.

If you're looking for further reassurance, note that I only tweaked a
couple of obscure things in the Perl 4 regression tests to get them to
work with Perl 5.  And I really don't think that Learning Perl is going
to discuss the practice of doing "goto" into a "while (0)" loop, or
intentionally writing syntactically incorrect evals to see which line
number the error is reported on.

That being said, I should point out that I may deprecate certain Perl4isms.
But they'll still work in Perl 5.

Larry
Newsgroups: comp.lang.perl
From: schwager@mike.cs.uiuc.edu (Mike Schwager)
Subject: Details regarding the exec command
Organization: University of Illinois, Dept. of Comp. Sci., Urbana, IL
Date: Fri, 18 Dec 1992 21:52:49 GMT



Everyone please open their Bibles to page 143... :-)

I'm trying to understand the "exec" call better.  I notice on the
aforementioned page that if I do

$shell = '/bin/csh';
exec $shell '-sh';
die "barf\n";

Then the shell believes it is a login shell- ie, $0 must be "-".  However,
if I do this:

exec '/bin/csh' '-sh';

it gives me an error, and if I do this:

exec $shell, '-sh';

it is not a login shell.  I don't understand The Book here, nor is it clear
what a "multi-valued list" is.  What exactly is exec'ed in the first
example?  Why does it work, whereas if I explicitly use the string
'/bin/csh' it fails?  Please enlighten me.
-Mike
aka, Mike Schwager               |"I will never apologize for the United States
INTERNET:schwager@cs.uiuc.edu    | of America, ever.  I don't care what the
Bye, George!!!                   | facts are."  -George Bush
University of Illinois, Dept. of Comp. Sci., for whom I do not speak
Newsgroups: comp.lang.perl
From: jsparkes@bcars68a.bnr.ca (Jeff Sparkes)
Subject: unpack and shift idiom?
Organization: Bell-Northern Research Ltd., Ottawa
Date: Wed, 16 Dec 1992 18:00:58 GMT

I'm reading binary data from a network stream.  I've accumulated the data in
a variable called $data, and am taking it apart in chunks.  The code
looks like:
	@output = unpack("L4S6", $data);
	$data = substr($data, 28);
	@names = unpack("A20", $data);
	???

I'm concerned by the need to use a constant as the arg to substr, especially
since I calculated it wrong the first time, and it took me a while to find.
This gets especially hairy when I pull strings out of the data stream, since
I don't know how many bytes to skip after unpacking A strings because some
stripping occurs.

Please tell me I'm missing something!
--
--
Jeff Sparkes jsparkes@bnr.ca	Bell-Northern Research, Ottawa (613)765-2503
You know, a muffin can be *very* filling.
Newsgroups: comp.lang.perl