HDTenEightyP/NetNews huggingface dataset:
From: neeri@iis.ethz.ch (Matthias Neeracher)
Subject: Re: Thanks to all of you that bought camel books!
Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
Date: Sun, 13 Dec 1992 21:49:40 GMT

merlyn@ora.com (Randal L. Schwartz) writes:
>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.

Somehow I feel that Marlon Brando would be ideally suited to this role...

"I'm writing you a script you can't refuse"

Matthias

Newsgroups: comp.lang.perl
From: lendl@cosy.sbg.ac.at (Otmar Lendl)
Subject: Statistic routines ?
Keywords: statistic
Organization: University of Salzburg / Austria
Date: Sun, 13 Dec 1992 19:33:45 GMT

I have to do some statistical analysis of data I gather with
perl scripts, so it would be convenient to use perl for that
purpose, too.

Before I start to write my own set of functions (Mean, standard-deviation,
histograms, ...) I better ask if there are already such beasts.
I checked the script-archives listed in the FAQs (convex, ohio-state),
but could not find anything suitable.

Can anyone give me pointers ?

/Otmar
-- 
|Otmar Lendl (lendl@cosy.sbg.ac.at) | Student of CS & Math at Salzburg |
|Akademiestr. 15  A-5020 Salzburg   | University (Austria / Europe)    |
| Put the scrabble away Arthur, it won't save the human race !  Ford P.|
From: ht@datani.dk
Newsgroups: comp.lang.perl
Subject: Re: perl-binary for INTERACTIVE
Date: 17 Dec 92 21:29:53 GMT
Distribution: eunet
Organization: Datani A/S, Copenhagen, Denmark

Distribution: eunet

In article <1086@tglobe2.tollpost-globe>, beni@tglobe2.tollpost-globe (Beni Ruef) writes:
> Is there anybody who is willing to mail me the above beast ?
> 
I have two versions of the wanted 'beast':
   - Interactive 3.2.2 with interactive TCP/IP
   - Interactive 3.2.2 with Wollonggong TCP/IP (a rather old version
        unfortunately)
Drop me a line if you want either.
>
>Thanks in advance
>-Beni
---
Henrik Tougaard             Postmaster, News-Reader and general dogsbody
Datani A/S, Software Consultants
Copenhagen, Denmark         Only my own opinions........

Mail to you bounces at the nameserver, therefore the post. Apologies to all!
Newsgroups: comp.lang.perl
From: ggr@nareen.acci.COM.AU (Greg Rose)
Subject: Re: timing problem with $SIG{'CHLD'}
Organization: Australian Computing and Communications Institute
Date: Sun, 13 Dec 1992 23:56:32 GMT

In article <9=h2hs#@rpi.edu> nobled@rebecca.its.rpi.edu (David Noble) writes:
>    until ($addr = accept(NS,S))
>	{ die $! unless $! eq 'Interrupted system call'; }
>
>Of course, this breaks if the text of the error message varies for
>different platforms. In that case, you would have to check for any
>variants on the interrupted system call message. Anybody know offhand
>whether the text of $! is defined by perl or the operating system?

My understanding is that the text of the error message comes from
somthing that (eg. IBM) vendors often change, but the *NUMBER*
associated with the error is defined by POSIX. So I always use

sub EINTR { 4; }

until ($addr = accept(NS,S)) {
	die $! unless $! == &EINTR;
}
--
Greg Rose                 Australian Computing and Communications Institute
ggr@acci.com.au                                              +61 18 174 842
`Use of the standard phrase "HIJACKED" may be inadvisable' -- CAA
Newsgroups: comp.lang.perl
From: lwall@netlabs.com (Larry Wall)
Subject: Re: unpack and shift idiom?
Organization: NetLabs, Inc.
Date: Sat, 19 Dec 1992 21:50:50 GMT

In article <1992Dec18.185143.17096@bcars6a8.bnr.ca> jsparkes@bcars68a.bnr.ca (Jeff Sparkes) writes:
: 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.

If you really want to unpack a pointer, try the 'p' template specifier.
But I'm curious as to how you can read a meaningful char* from a network
stream.  The situation doesn't arise often in practice.

: 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.

You make it sound as though the number of bytes used is indeterminate.
The number of bytes used is unambiguously determined by the template,
unless you use a *, in which case you either don't care anymore, or you
intend to measure the length of what was returned by the *.

Larry
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: Sat, 12 Dec 1992 19:46:03 GMT

In article <1992Dec12.100131.11703@zooid.guild.org>,
 Mike Stramba <stramba@zooid.guild.org> writes:

|  If I have the string :
| 
|           Exxxxppppppprrrrrrreeeeesssssiiiiiiiiioooooonnnnnnnnnsssssssss
| 
|  and I want to kill the duplicated letters and end up with:
| 
|           Expressions
| 
|  Lets' see some of your elegant solutions !

And, of course, no solution will be considered elegant unless it produces

  ``Goofy'' with the input ``Goooooofffffyyyy''.

-- 
 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
From: Mike Stramba <stramba@zooid.guild.org>
Newsgroups: comp.lang.perl
Subject: programming challenge
Date: Sat, 12 Dec 1992 10:01:31 GMT
Organization: The Zoo of Ids

Ok, all you perl wizards out there.

This out'a be a snap for ya.

 If I have the string :

          Exxxxppppppprrrrrrreeeeesssssiiiiiiiiioooooonnnnnnnnnsssssssss

 and I want to kill the duplicated letters and end up with:

          Expressions

 Lets' see some of your elegant solutions !

 Btw, this problem came up as a result of trying to edit a formatted man
 page ... for guess what program ?  (starts with 'P ... ends with 'l')

 Why am I editing a man page? ... because my computer, an Atari doesn't know
 about them.

 I'm interested in seeing solutions to the above, anyway.

Mike
From: tcking@uswnvg.com (Tim King)
Newsgroups: comp.lang.perl
Subject: Re: programming challenge
Date: 16 Dec 92 23:12:13 GMT
Organization: U S WEST NewVector Group, Inc.
X-Newsreader: Tin 1.1 PL5

: 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!)
: 

Cameron Simpson (cameron@spectrum.cs.unsw.oz.au) wrote:
: Ugh. Unless I'm missing something basic, this will work (and I've used this
: script for years):
: 
: 	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.

Ugh, Ugh.  Unless ~I'm~ missing something basic, the 'col' utility is
specifically for this purpose, stripping out ^H and repeated text.  Works
for underlines too, gals.

col -bx < man.out > man.text

--
Tim King, tcking@uswnvg.com or uunet!uswnvg!tcking
US West NewVector Group Inc., Bellevue, Washington
206-450-8533
From: mark@coombs.anu.edu.au (Mark)
Newsgroups: comp.lang.perl
Subject: Re: ftp sites
Date: 18 Dec 92 04:28:00 GMT
Organization: Australian National University
NNTP-Posting-Host: 150.203.76.2
Organisation: Wassat?!

schrod@iti.informatik.th-darmstadt.de (Joachim Schrod) writes:

>A related question: Is there anywhere a place (read: ftp site) where
>contributed perl packages are collected, like the elisp archive? Eg,
>if no such package -- as outlined above -- exists and I write one,
>how's the procedure to contribute it? It's not a big deal to write,
>but I don't want to reinvent the wheel; perhaps others don't want it
>too...

Yup, there are a few... here's a pointer to mine..

README file from /pub/perl on coombs.anu.edu.au[150.203.76.2]

-=-=-=-=-=-=-=-=-=-=-=-
Australian Perl Archive
-=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-
Please Note  Please restrict ftp times to outside normal business hours for
-=-=-=-=-=-  this site:
                          8:30am -  6:00pm AEDT -- Aussie
                          1:30pm - 11:00am PDT  \
                          3:30pm -  1:00am CDT   >-- USA
                          4:30pm -  2:00am EDT  /
   *** See below *** <-- 10:30pm -  8:00am GMT  -- Europe

This archive is maintained by mark@coombs.anu.edu.au

Scripts are currently obtained from:

archive.cis.ohio-state.edu   /pub/perl       Last: 20 Oct 92
convex.com                   /pub/perl       Last: 20 Nov 92
sra.co.jp                    /pub/lang/perl  Last: 15 Oct 92
comp.lang.perl.                              Last: 20 Nov 92

Note: European users please use the mirror site on src.doc.ic.ac.uk[149.169.2.1]
      in /programming-languages/perl/coombs-scripts. The link speed would
      be a lot better for all. Contact L.McLoughlin@doc.ic.ac.uk for more
      information. It is updated daily.

See the file INDEX for a description of each script.
Please deposit any scripts in the 'incoming' directory

Share and enjoy.

Mark.
mark@coombs.anu.edu.au         Voice: +61-3-660-3130    Fax: +61-3-639-1685
mark@gnu.ai.mit.edu            Technical Services, Faculty of Social Sciences 
markm@rmit.edu.au              Communications Dept. RMIT, Melbourne, Australia.
Newsgroups: comp.lang.perl
From: Dov Grobgeld <dov@menora.weizmann.ac.il>
Subject: Re: Wanted: Perl script to convert file names from Unix to DOS
Reply-To: dov@menora.weizmann.ac.il
Organization: The Internet
Date: Sun, 13 Dec 1992 08:23:41 GMT

In his message ayman@eecs.umich.edu (Ayman I. Kayssi) said:

| : 
| : >It would be nice if the algorithm used can be
| : >inverted, so that the Unix filenames can be extracted back from their
| : >DOS translation.
| : 
| : In general, I don't think that will be possible unless the Unix filenames
| : are already in 8x3 format with no unacceptable characters.   The only way 
| : you could do it reliably would be to save a table and use it for the
| : conversion back.
| 
| I thought so too, but maybe there is some  magic way to do it.
| 

You cannot do a one-to-one mapping between a larger set and a smaller set.
Since the set of allowed unix file names is much larger than the set of
allowed DOS file names, your case is hopeless. It is mathematically impossible
to do what you want to do. The only way around it is by a providing a
lookup table of how you did the translation.

--
                                                        ___   ___
                                                      /  o  \   o \
Dov Grobgeld                                         ( o  o  ) o   |
The Weizmann Institute of Science, Israel             \  o  /o  o /
"Where the tree of wisdom carries oranges"              | |   | |
                                                       _| |_ _| |_
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Newsgroups: comp.lang.perl
Subject: Re: In 5.0, are we gonna get...
Date: 14 Dec 92 19:20:07 GMT
Organization: Loral Western Development Labs

In article <1992Dec14.043835.23009@reed.edu> mjeffery@reed.edu (Mark Jefferys) writes:
>Will we see:
>
>1) an equivalent of lisp's mapcar?  For an instance:
>
>	map(/(\d+)/, "asdf 23fjk4", "qwerty", "123 ")
>
>   would return ("23", "4", "123").

Easily constructed using grep:

        grep((/(\d+)/,$_=$1), "asdf 23jfk4", "qwerty", "123 ")

produces ("23", "123") (Even lisp's mapcar only applies the function once per
sequence item.)  Larry has talked about adding a 'reduce' operator that
calls a special sort like function (used $a,$b for arg passing) on each element 
of a list for doing summations like so:

	$sum = reduce {$a+$b} 1,34,$x,45,-8,0.1;
>
>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. 

I believe that ^ at the beginning of a pattern will only match the beginning
of a string and $ at the end only the end, $* has effect only on embedded
^ and $ in the middle of a pattern.
>
>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.

Larry and I have also talked about this, possibly using < > as the grouping
chars, as well as **, ++, and {n-m} which would be minimal length matching
versions of the current maximal length matching *, + and {n,m} and possibly
a prolog like cut operator (!?) to limit backtracking in patterns.

--
Perl's Maternal Uncle
Mark Biggar
mab@wdl1.wdl.loral.com
From: folta@cs.umd.edu (Wayne Folta)
Newsgroups: comp.lang.perl
Subject: Feature request for perl V
Date: 17 Dec 92 00:42:36 GMT
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742

Could grep have an added option/mode that would allow me to get an array
of indices instead of an array of items? I want to read a file into an
array, then do some greps in the array, some calculations, and then if
everything is right, make a couple of changes in the array, then write it
back out to the file. If I could do this:

   @line_numbers = grepi (/IN A/, @lines) ;

I'd be pretty happy. How's it sound?
-- 


Wayne Folta          (folta@cs.umd.edu  128.8.128.8)
Newsgroups: comp.lang.perl
From: jbotz@mtholyoke.edu (Jurgen Botz)
Subject: Perl & manipulating large texts
Organization: Mount Holyoke College
Date: Thu, 17 Dec 1992 18:14:47 GMT

I was recently playing with some parsing stuff in the process of
trying to parse a very large (> 1MB) text file, and I found myself
unable to determine how to deal with the text efficiently.  I'd like
some input on this... here are the parameters of the problem:

- I can't just read line by line because I might have to backtrack.

- I need to be able to address individual character positions, not
  just lines.

- I need to be able to use regexps to match chunks of text from the
  beginning (possibly crossing line-boundaries) and then use the
  matched chunk for something and then repeat with the text beyond
  what was matched.  (i.e. bite off chunks from the beginning.)

A powerful idiom that makes the lexical part very easy is being able
to use regular expressions and the get the text that matched from
$& and the rest of the text for the next pass from $'.  However,
it seems to me that sucking a > 1MB file into a scalar and then
iterating with something like...

  $* = 1;
  while (/$pat/) {
	$match = $&;
	$_ = $_;
	&do_something_with($match);
	$pat = &next_pat();
   }

must be prohibitively inefficient.  I guess essentially the problem is
that I can't find a way to use a C-like idiom with pointers into
the text.  Maybe Perl 5 references will take care of this?  I noticed
that "substr" returns an L-value, but couldn't find any way to take
advantage of that fact.

--
Jurgen Botz                  |   Internet: JBotz@mtholyoke.edu
Academic Systems Consultant  |     Bitnet: JBotz@mhc.bitnet
Mount Holyoke College        |      Voice: (US) 413-538-2375 (daytime)
South Hadley, MA, USA        | Snail Mail: J. Botz, 01075-0629
Newsgroups: comp.lang.perl
From: lwv26@cas.org (Larry W. Virden)
Subject: Looking for updates/enhancements to the perl man command
Reply-To: lvirden@cas.org (Larry W. Virden)
Organization: Nedriv Software and Shoe Shiners, Uninc.
Date: Fri, 18 Dec 1992 14:00:40 GMT

There are at least two things in the perl version of man that I would like
to see changed - and since I don't speak perl yet, I was wondering if anyone
out there has the gumption to take them on.

1. I get errors such as the following often:
can't store Tcl_FindHashEntry.3 -- would break DBM

Is this something that can be fixed ?

2. I would LOVE to have man look at the whatis database and, if it is
older than one of the man page directories, run a makewhatis (if the
user has permission to do so of course).  The problem is that when one
is maintaining a community directory of man pages, some folk forget to
run it when necessary and then call for help when their man page doesn't
show up.

Other things that I would LOVE to see in this man:

1. The cat pages able to be compressed.  This doesn't seem to work right now
on my SunOS 4.1.2 OS and perl 4.0.1.7 version...

2. The ability to special a special file formatter for certain directories.
This would allow me to put texinfo or postscript doc into special locations
and man could invoke an appropriate display program on them.

I would also be interested in hearing about other enhancements folks have
made to the package.

Thanks!
-- 
Larry W. Virden                 UUCP: osu-cis!chemabs!lvirden
Same Mbox: BITNET: lvirden@cas  INET: lvirden@cas.org
Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614
Newsgroups: comp.lang.perl
From: ckd@eff.org (Christopher Davis)
Subject: Re: using grep to extracting matching elements from an array
Organization: Electronic Frontier Foundation Tech Central
Date: Wed, 16 Dec 1992 18:52:30 GMT

KK> == Kenneth Kron <kron@ueshiba.Corp.Sun.COM>

 KK> I'd like to count the number of elements in an associative array whose
 KK> keys match an re.

 KK> @Group = grep("home", keys %LocalDisks) ;
 KK> print join(" ", @Group) ;

 KK> But group is always ALL the keys.

"home" is a true value.

/home/ is a regexp match for "home" on $_.

 KK> I know there are other ways to do this but what I want to know is what
 KK> don`t I understand about the GREP FUNCTION???

It evaluates the first item in the list as an expression, and if it gets a
true value, puts the current element into its return list.
--
Christopher K. Davis      | ``Usenet seems to run much like the Kif (or,
<ckd@eff.org>   EFF #14   |   for the TV generation, Klingon) high command.
System Administrator, EFF |   Whoever takes action and can be heard wins.''
+1 617 864 0665  [CKD1]   |   --Peter da Silva <peter@ferranti.com>
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Newsgroups: comp.lang.perl
Subject: Re: Is this a bug...
Date: 14 Dec 92 19:29:57 GMT
Organization: Loral Western Development Labs

In article <1gi84dINNhcv@armory.centerline.com> thomaso@centerline.com (Thomas Andrews) writes:
>It appears that calling a subroutine with no argument list is not the
>same as calling the subroutine with an empty argument list.  That is,
>	&foo();
>is different from
>	&foo;
>I could not find documentation for this in the camel book.  Is this
>a bug or a feature?
>In particular, the following prints out "Just another Perl hacker,":
>sub func {
>	print join(" ",@_),"\n";
>}
>sub main {
>	&func;
>}
>&main("Just","another","Perl","hacker,");
>while if main were defined as:
> sub main {
>	&func();
> }
>It would print a blank line...

This behavior is implied by the explaination in Para 5 of the section on 'do'
Page 138 of the camel book.  It says "If you omit the parentheses, no @_
array is passed to the subroutine."  Given how the dynamic scoping of perl
variables works, if no @_ is passed to a subroutine, any references to @_
in the subroutine must be to the @_ currently in the dynamic scope of the 
subroutine which is usually the @_ of the calling routine.  Larry and I have
discussed making the @_ of a subroutine one of the new lexical variables, but
that would break any script dependent on the current dynamic scoping behavior.

--
Perl's Maternal Uncle
Mark Biggar
mab@wdl1.wdl.loral.com
Newsgroups: comp.lang.perl
From: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
Subject: Perl IV & V incompatibilities?
Reply-To: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
Organization: Motorola Codex, Canton, MA
Date: Thu, 17 Dec 1992 17:54:20 GMT


I'm getting a little bit scared about Perl V - I have lots of Perl IV code
and I'm scared that it'll all have to be rewritten when I move to Perl V.
So my question is very simple - what _isn't_ compatible?  What will need
to be rewritten?

If this is in the FAQ then I apologize....

Lezz "JAPIVH" Giles
Newsgroups: comp.lang.perl
From: neve@nlm.nih.gov (Leif Neve)
Subject: Infoperl Available?
Reply-To: neve@nlm.nih.gov
Organization: National Library of Medicine
Date: Tue, 15 Dec 92 16:16:47 GMT

Is there a version of perl available yet for Informix?
Something akin to sybperl and oraperl.

Thanks,
Leif Neve

Newsgroups: comp.lang.perl
From: Mike Stramba <stramba@zooid.guild.org>
Subject: Re: programming challenge
Organization: The Zoo of Ids
Date: Tue, 15 Dec 1992 07:06:53 GMT
	<1992Dec14.185822.7058@wdl.loral.com>

  In article <1992Dec14.185822.7058@wdl.loral.com>,
  mab@wdl39.wdl.loral.com (Mark A Biggar) writes:

>This looks like a job for s.... oops he's dead, oh well how about the 
>'s' modifier of the tr command like so:
>
>perl -pie 'tr///cs/;' <files>
>
>which zaps all consecutive chars in the files.  
>To limit it to just letters use:
>
>perl -pie 'tr/a-zA-Z//s;' <files>
>
>but of course this doesn't really solve the 'Goofy' problem which doesn't
>have a general solution even with the addition of dictionary lookup because
>word pairs like 'met' vs 'meet'.  That problem looks like it take a full
>English understanding AI to solve.
>

Yup, the 'tr.../s' command is the solution, as far as what I needed.

I just got the Camel book (now I know why it's called that !) and there it was
under 'Common Tasks with Perl'.

It may be in the man page as well, but I haven't managed to read it all yet !

I noticed the 'Goofy' problem as well, but that isn't too important.

What I was puzzling over tonight was whether there was a single line 's/'
command syntax to delete all '_' characters but not '$_'. I did it with 
two lines:

  s/( )_/$1/g;             # change ' _'  to ' '
  
  s/(\w)_/$1/g;            # change '\w_' to '\w'

There probably wouldn't be any advantage to having it in one line ???

Mike












Newsgroups: comp.lang.perl