HDTenEightyP/NetNews huggingface dataset:
From: ckd@eff.org (Christopher Davis)
Subject: Re: bug in ctime.pl?
Organization: Electronic Frontier Foundation Tech Central
Date: Wed, 22 Jul 1992 02:10:43 GMT

Paul> == Paul A Sand <pas@anchor.unh.edu> 

 Paul> Based on some peculiar behavior, I looked at the ctime.pl library
 Paul> file. It contains the line:

 Paul>      $year += ($year < 70) ? 2000 : 1900;

 Paul> where $year is one of the elements returned from gmtime() or
 Paul> localtime(). Looking at the definitions of what *those* return,
 Paul> it seems the statement should be simply:

 Paul>     $year += 1900;

 Paul> Or am I missing something subtle?

The subtle thing you're missing will become clear in about 8 years, when
your modified version tells you that it's 1900.  This is okay if you're
writing a real-time Diplomacy game program, but kinda sucks for use in
other applications, if you know what I mean.

The magic number 70 is from the Unix epoch of Jan 1, 1970.

--
Christopher Davis * ckd@eff.org * System Administrator, EFF * +1 617 864 0665
   ``The First Amendment is often inconvenient.  But that is besides the
  point.  Inconvenience does not absolve the government of its obligation
         to tolerate speech.'' --Justice Anthony Kennedy, in 91-155
From: jack@richsun.cpg.trs.reuter.com (Jack Gidding)
Newsgroups: comp.lang.perl
Subject: Perl for NeXT?
Date: 22 Jul 92 13:19:44 GMT



Hi,

Can someone tell me where I can get Perl for the NeXT? and how big is it?

Thanks,

Jack Gidding
jack@richsun.cpg.trs.reuter.com
Newsgroups: comp.lang.perl
From: rahardj@ccu.umanitoba.ca (Budi Rahardjo)
Subject: Re: X thing to get string?
Organization: University of Manitoba, Winnipeg, Canada
Date: Fri, 24 Jul 1992 11:40:27 GMT

mcmahan@cs.unca.edu (Scott McMahan -- Genesis mailing list owner) writes:
>Is there an X program, preferably Motif-oriented (not that I'm that
>picky :^)), that will pop a dialogue box, get a string from the user,
>and print it on the stdout?

In X-icon (X extension of Icon) there is an example of such program
called 'xprompt'. It generates a small executable too.

-- budi

If you're curious, here is the program :

#	Name:	xprompt.icn
#	Title:	X Prompt
#	Author:	Clinton L. Jeffery
#	Date:	Sept 17, 1991
#
# An X-Icon utility for interactive shell scripts.  Called from a
# shell script, it pops up an X window, writes its arguments out as
# a prompt, and echos the user's response to standard output where
# the shell script can use it (by means of the backquote character).
#
procedure main(args)
  pos := "pos="
  every s2 := XQueryPointer() do pos ||:= (s2-10) || ","
  w := open("xprompt","x","font=12x24","lines=1",pos[1:-1]) |
     stop("opening the window fails")
  every writes(w,!args," ")
  write(read(w))
end
-- 
Budi Rahardjo <rahardj@ccu.umanitoba.ca>
Unix Support - Computer Services - University of Manitoba
Newsgroups: comp.lang.perl
From: rafapa@obelix.cica.es
Subject: Perl 4.035 and CONVEX
Reply-To: rafapa@obelix.cica.es
Organization: The Internet
Date: Wed, 22 Jul 1992 12:08:25 GMT

|X-Envelope-to: perl-users@uvaarpa.virginia.edu


    I know that CONVEX support Perl but my system is still using the
3.18 version of Perl (9.1 ConvexOS). I am trying to update to Perl
4.035 but the C compiler complaint in the routine doio.c at lines
2194 and 2281 because a type redefinition problem.
    Could someone give me a Convex hints file? I am using all the 
defaults options in Configure.
	Thanks
		Rafael R. Pappalardo
		Dept. Physical Chemistry
		Univ. Seville (SPAIN)
		e-mail: rafapa@obelix.cica.es
From: mooring@grimoire.tymnet.com (Ed Mooring)
Newsgroups: comp.lang.perl
Subject: Re: Problem with order of precedence, maybe
Date: 30 Jul 92 19:33:31 GMT
Organization: BT Tymnet Bit Bucket Brigade

In article <1992Jul30.150500.9873@convex.com> tchrist@convex.COM (Tom Christiansen) writes:
>From the keyboard of sherman@unx.sas.com (Chris Sherman):
>:Consider the following code:
>:
    [ test program to uncover a bug written by yours truly ]

>Check K&R: == and != bind more tightly than &.  Unfortunately,
>they bind less tightly than &&, which is why people want get
>confused.  I just tracked down a dozen cases of this in our
>kernel and utils source (in C).
>
>--tom

It only slightly relieves my embarassment that I'm not the only
one who suffered this lapse, especially in light of the warnings
from The One True Man Page:

         When in doubt, parenthesize.  At the very least it  will
         let some poor schmuck bounce on the % key in vi.

         Even if you aren't in doubt, consider the mental welfare
         of  the  person  who has to maintain the code after you,
         and who will probably put parens in the wrong place.

Regards,
Ed Mooring (mooring@tymix.tymnet.com 408-922-7504)
Newsgroups: comp.lang.perl
From: andyc@eliot.uucp (Andy Panda Collins)
Subject: Re: Capitalizing words?
Organization: Systems Center, Inc., Reston, VA, USA
Distribution: na
Date: Thu, 23 Jul 1992 18:09:19 GMT

Capitalizing a list of words :
Do you have any books on perl?
If not your trouble is understandable, otherwise
just get the book and look up the spiffy command tr
This little command is very similar, in fact, functionally
the same as the tr unix utility.
suppose you want to caps a single variable,
$spiff for instance
just do the following
$spiff=~tr/a-z/A-Z/;
The best book on perl is probably the O'Reilly nutshell book
A list of perl scalar operators is listed on page 10 of this book.
If you don't have a book on perl, get one, and until then better
hope you have a good set of man pages.

To finish up make a function that take a list and returns the
capitalized list. If you don't know functions, then you should
find out.
Newsgroups: comp.lang.perl
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: *Another* embarrassingly simple question
Originator: tchrist@pixel.convex.com
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: CONVEX Realtime Development, Colorado Springs, CO
Date: Thu, 23 Jul 1992 03:24:22 GMT
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of sondeen@isi.edu (Jeff Sondeen):
:How can I print a number as binary?  What I want is
:	$num = 5;
:	print "%4b", $num;	# but it doesn't give me 0101
:		^^^
:		wishfull thinking

Use:

	print unpack('B*', pack('N',$number))

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist


    It's all magic.  :-)        --Larry Wall in <7282@jpl-devvax.JPL.NASA.GOV>
From: jba@ai.mit.edu (Jonathan Amsterdam)
Newsgroups: comp.lang.perl
Subject: back-references in regexps
Date: 22 Jul 92 18:13:49 GMT
Distribution: comp
Organization: MIT Artificial Intelligence Laboratory

I've been looking closely at Perl regular expressions and have noticed some
interesting things about back references:

1. It is possible to have a valid back-reference (i.e. one that doesn't
   always fail) inside its own paren. E.g. /(a(b|\1))+/

2. It is possible to have a valid back-reference before its paren.
   E.g. /(\2|(\w))+/

3. A back-reference can succeed even if its paren was part of a failure
   earlier in the scan.  E.g. /((ab)d|abc)\2/ will match "abcab".  


I'm particularly interested in 3.  Is it a commonly known fact?  Is it
considered a feature or a sort of fall-through-the-cracks don't-care kind
of thing?  (One might at first believe, or even wish, that a back-reference
to something that failed would also fail.)

Does anybody have any scripts that use any of the above three properties?

	Thanks,
	Jonathan Amsterdam
Newsgroups: comp.lang.perl
From: dbeedle@rs6000.cmp.ilstu.edu (Dave Beedle)
Subject: h2ph won't convert socket.h...
Date: Tue, 21 Jul 1992 16:53:07 GMT
Organization: Illinois State University

   Hi all.  I'm a rank amature when it comes to perl but I went ahead and 
updated the perl on our rs6000 running AIX 3.1.5.  It did have socket.ph at 
one time but now does not.  h2ph will not convert it for some reason here is 
what I get...

/usr/include/sys $ h2ph socket.h
socket.h -> socket.ph
Can't open socket.h: No such file or directory
/usr/include/sys $ di so*
-r--r--r--    1 bin           10B  May 19 1990   Jul 21 11:45 socket.h

   What's going on?  Thanks for any hints!

TTFN
-- 
  Dave Beedle                                    Office of Academic Computing
                                                    Illinois State University
  Internet:  dbeedle@rs6000.cmp.ilstu.edu                    136A Julian Hall  
  "Relax, don't worry!  Have a homebrew!"                  Normal, IL   61761
Newsgroups: comp.lang.perl
From: mike@meiko.com (Mike Stok)
Subject: Re: getting started
Organization: Meiko Scientific Corp.
Date: Thu, 23 Jul 1992 11:33:10 GMT

In article <1992Jul22.212350.12051@tamsun.tamu.edu> rse8135@dewie.tamu.edu (R.S. Etheredge) writes:
>Howdee,
>I am a brand new introductee to the wilds of perl. I have purchased an  
>O'Rielly & Associates book entitled Programming perl, by Larry Wall and  
>Randall Schwartz. I have just started reading the Getting Started chapter.  
>Anybody have experiences to help accellerate the learning curve?
>Have a happy day...

Rusty,

*don't* think in C, I always found that saying a perl expression or
construct out loud helped me, it's a much more 'human' language than
C.  Also remember that lots of decisions are better as until or unless
rather than the while (! condition) and if (! condition).  Also perl's
the only language I've found where the number of "right" ways of doing
things is comparable with the number of "wrong" ways :-)

Mike

--
The "usual disclaimers" apply.    | ... many were weak and confused, succumbing
Mike Stok                         | to drink or drugs whenever possible ...
mike@meiko.com                    |
Meiko tel: (617) 890 7676         |                          Hunter S. Thompson
Newsgroups: comp.lang.perl
From: mcmahan@cs.unca.edu (Scott McMahan -- Genesis mailing list owner)
Subject: Re: X thing to get string?
Organization: University of North Carolina at Asheville
X-Newsreader: Tin 1.1 PL3
Date: Wed, 22 Jul 1992 22:11:46 GMT

I like the brute-force method, and the path-of-least-resistance.
xterm -e is very much both ;)

Any chance of getting

Motifperl

with Motif integrated into perl the same way curses & stuff is?

That would be *the* best windows programming environment ever
designed. :)

(I'm trying to learn enough motif to do what I want -- I'll probably share
the results in alt.sources, so stay tuned...)

Scott
From: jpr@sun4.lri.fr (Jean-Pierre Riviere)
Newsgroups: comp.lang.perl
Subject: Perl on the Amiga ?
Date: 27 Jul 92 08:27:20 GMT
Organization: Laboratoire de Recherche en Informatique


Is there any Perl for the Amiga (surely :) ?
If so, where may I get it ?
Thanks in advance. email answer prefered.


-- 
  Jean-Pierre RIVIERE        |     ///
  LRI - Universite Paris Sud | \\\///
  e-mail : jpr@lri.lri.fr    |  \///
Newsgroups: comp.lang.perl
From: weingart@inf.ethz.ch (Tobias Weingartner)
Subject: Pipe, et al, what am I doing wrong?
Followup-To: comp.lang.perl
Keywords: pipe, fork
Reply-To: weingart@inf.ethz.ch
Organization: ETH - Switzerland
Date: Mon, 27 Jul 1992 11:57:15 GMT

Here is a small script, that seems to hang.  What am I doing
wrong?  A ps shows that the child is waiting for the parent
to `wait` on it.  Also, the parent seems to hang because it
does not get EOF.


#!/usr/local/bin/perl
#
# To test fork, pipe
# and other things.

select(STDIN); $| = 1;
select(STDERR); $| = 1;
select(STDOUT); $| = 1;

pipe( READH, WRITEH );
$pid = fork();
die "Could not fork.\n" if( ! defined($pid) );

@data = ();
if( $pid == 0 ){
	open(STDOUT, ">&WRITEH");
	open(STDERR, ">&WRITEH");
	exec( '/bin/cat', '/etc/passwd' );
}else{
	open(STDIN, "<&READH");
	while( <STDIN> ){
		push(@data, $_);
		print ".";
	}
	print "\nLines: $#data\n";
}

exit(0);

#
# End of script.


Can anyone give me a working example of this?

TNX in advance!

--Toby.

Newsgroups: comp.lang.perl
From: hamjavar@carina.unm.edu (Farid Hamjavar)
Subject: FAQ
Date: Sun, 26 Jul 92 20:49:54 GMT
Organization: University of New Mexico, Albuquerque


Hello Everyone :

Since I have just started learning 'perl' [WAS FED UP WITH CSH], FAQ can
save me [ANY YOU ALL] of posting unnecessary/trivial  questions.

Is there any such FAQ list for this news group?

ThankS in advance.
Farid Hamjavar
hamjavar@carina.unm.edu
From: robt@is.morgan.com (Rob Torop)
Subject: Re: @ARGV
Organization: Morgan Stanley & Company
Date: Fri, 31 Jul 1992 17:12:48 GMT

In article <1992Jul31.003911.12553@uvaarpa.Virginia.EDU> toro.MTS.ML.COM!scott%beethoven@uunet.uu.net (Scott Strool) writes:
Path: is1.is.morgan.com!s5!uunet!dtix!darwin.sura.net!uvaarpa!mmdf
   From: toro.MTS.ML.COM!scott%beethoven@uunet.uu.net (Scott Strool)
   Newsgroups: comp.lang.perl
   Date: 31 Jul 92 00:39:11 GMT
   Sender: mmdf@uvaarpa.Virginia.EDU (Mail System)
   Reply-To: Scott Strool <toro.MTS.ML.COM!scott%beethoven@uunet.uu.net>
   Organization: The Internet
   Lines: 13

   How can I get the individual characters from the command line variable.
   for instance if the user entered 'xbr'. I want to know that the first char
   is 'x', second is 'b' and third is 'r'.

   thanks,
   srs
   Scott Strool
   Consultant
   Merrill Lynch & Co Inc.
   Tel: (212) 449-1456
   Fax: (212) 449-1465
   scott@ml.com
   uunet!toro!scott

This should do the trick:

@chars = split(//, $ARGV[0]);

The individual characters will then be $chars[0], etc...

-- Rob Torop

+---------------------------------------------------------------------+
| The views expressed here are neither mine nor those of my employer. |
+---------------------------------------------------------------------+


--
-- Rob Torop

+---------------------------------------------------------------------+
| The views expressed here are neither mine nor those of my employer. |
+---------------------------------------------------------------------+
From: throop@aurs01.UUCP (Wayne Throop)
Newsgroups: comp.lang.perl
Subject: Re: X thing to get string?
Summary: here's one, but I warn you, it's gross...
Date: 22 Jul 92 19:49:20 GMT
Organization: Alcatel Network Systems, Raleigh NC

> Is there an X program, preferably Motif-oriented (not that I'm that
> picky :^)), that will pop a dialogue box, get a string from the user,
> and print it on the stdout?

Soit'ny.  I warn you, it's pretty gross (rendered in sh, not csh):

    xterm -e sh -c 'echo -n Enter some string or other;head -1 1>&3' 3>&1
or
    xterm -title 'Enter some string or other' -e sh -c 'head -1 1>&3' 3>&1

This just MAY be the most expensive pop-up dialog box known to humankind.
Of course, it can be decorated in the usual way with geometry hints, 
size hints, header bar name, fonts, background/foreground colors, etc, etc.

Wayne Throop       ...!mcnc!aurgate!throop
From: frank@iris.ansto.gov.au (Frank Crawford)
Newsgroups: comp.lang.perl
Subject: Re: Commercial alternatives to perl?
Date: 22 Jul 92 00:38:19 GMT
Organization: Australian Nuclear Science and Technology Organisation

In article <CKD.92Jul15213524@loiosh.eff.org> ckd@eff.org (Christopher Davis) writes:
>
>Sorry if I confused you; I was trying to make fun of the type of MIS
>dweebs who insist on ``commercial'' support, which is often useless,
>instead of getting a feed of comp.lang.perl or whatever from UUNET,
>which is both edifying and entertaining.

After watching what has happened to a sites after I left I'm not surprised
that MIS managers want ``commercial'' support.  To take advantage of any
net support you need at least one competent and interested programmer, and
if it is more that two or three products you'll need lots more just to
weed out the chaff.

Consider how much time you would have to spend reading news if your
organisation's computing was based entirely GNU products including PERL.
Or alternatively, some critical software is written in PERL, and the
person who wrote it leaves.  Any decent MIS manager wants to know where
he can go for support when he needs it.  At least for ``commercial'' support
it is the support organisations responsibility to supply the expertise.
(There is the obvious assumption that the support organisation is compentent.)

>--
>Christopher Davis * ckd@eff.org * System Administrator, EFF * +1 617 864 0665
>   ``The First Amendment is often inconvenient.  But that is besides the
>  point.  Inconvenience does not absolve the government of its obligation
>         to tolerate speech.'' --Justice Anthony Kennedy, in 91-155

							Frank Crawford
From: stuart@ds3100.new.dec.com (Stuart Broderick)
Newsgroups: comp.lang.perl
Subject: stat.pl query
Keywords: PERL
Date: 28 Jul 92 17:13:17 GMT
Reply-To: stuart@ds3100.new.dec.com (Stuart Broderick)
Organization: Digital Equipment Corporation

Probably a stupid question, but....

The following script is using stat.pl to determine the mode of a file
using stat.pl. 

#! /usr/local/bin/perl
require 'stat.pl';
do Stat('./test');
print $st_mode,"\t",$st_uid,"\t",$st_gid,"\n";

When this runs, I get 

st_mode st_uid  st_gid
33224   1103    100

When I do a "ls -lag ./test",  I get

-rwx--x---  1 stuart   espo       286720 Jul 28 17:56 ./test

The username and group are correct (st_uid, st_gid), but what does
st_mode relate to ? 
I expected it to give 0710. 

Can anyone tell me what I've done wrong ? I'm looking for a numeric
representation of 
the permissions field.

Stuart.
Newsgroups: comp.lang.perl
From: pas@kepler.unh.edu (Paul A Sand)
Subject: Re: bug in ctime.pl?
Organization: University of New Hampshire
Date: Wed, 22 Jul 1992 03:43:07 GMT

In article <CKD.92Jul21220835@loiosh.eff.org> ckd@eff.org (Christopher Davis) writes:
>Paul> == Paul A Sand <pas@anchor.unh.edu> 
>
> Paul> Based on some peculiar behavior, I looked at the ctime.pl library
> Paul> file. It contains the line:
>
> Paul>      $year += ($year < 70) ? 2000 : 1900;
>
> Paul> where $year is one of the elements returned from gmtime() or
> Paul> localtime(). Looking at the definitions of what *those* return,
> Paul> it seems the statement should be simply:
>
> Paul>     $year += 1900;
>
> Paul> Or am I missing something subtle?

>The subtle thing you're missing will become clear in about 8 years, when
>your modified version tells you that it's 1900.  This is okay if you're
>writing a real-time Diplomacy game program, but kinda sucks for use in
>other applications, if you know what I mean.

>The magic number 70 is from the Unix epoch of Jan 1, 1970.

That's not subtle enough :-). The references I've checked with regard
to the ANSI C functions gmtime() and localtime() claim that the
`tm_year' member of their 'struct tm' return value is simply 'years
since 1900', and don't say anything about 'modulo 100' or any special
handling for good old 1970 and before, or 2000 and after, for that
matter. This could be different in Perl, but the Camel book seems to
claim that it's not.
-- 
-- Paul A. Sand           | I learned to put the [toilet] seat down...it
-- Univ. of New Hampshire | makes you look like a warm, caring, sensitive
-- pas@kepler.unh.edu     | human being. (Prof. R. Noble, from r.h.f.)
From: ratzan@rwja.umdnj.edu (Lee Ratzan)
Newsgroups: comp.lang.perl
Subject: where to find perl
Summary: where to find perl
Keywords: perl
Date: 31 Jul 92 17:39:08 GMT
Distribution: comp
Organization: Robert Wood Johnson Medical School, Piscataway NJ

Unix machine. Whence do we obtain it? We looked at the Archie
server to find public sites but Perl is stored in directories
which themselves have sub-directories suggesting that either
the Perl system is immense or is packaged with a great deal
of excess baggage which we don't need. Can anyone suggest
a site and/or have experience in porting it to HP-UX?

Thank you.

Please respond directly to me.

Lee Ratzan
ratzan@umdnj.edu
Univ of Medicine and Dentistry of NJ
Newsgroups: comp.lang.perl
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: getting started
Originator: tchrist@pixel.convex.com
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: CONVEX Realtime Development, Colorado Springs, CO
Date: Fri, 24 Jul 1992 13:05:38 GMT
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of tanaka@til.til.com (Yokichi Tanaka):
:In article (R.S. Etheredge) writes: 
:|> Anybody have experiences to help accellerate the learning
:|> curve?
:
:Rob Kolstad's set of slides from the Software Development '90
:convention in Oakland (2/9/1990) is a good introduction.
:
:	PERL: A System Administration Language
:        Rob Kolstad, Ph.D.
:	kolstad@prisma.com
:	uunet!prisma!kolstad
:
:Phone # and e-mail address may be obsolete.
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'Tis true.  He now labours for BSDI, and this can be reached 
by directing mail to <kolstad@bsdi.com>.  

I believe we're talking the same set of slides, however, as
exist in the archive on convex.com in /pub/perl/tutorial/.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist
    [End of diatribe.  We now return you to your regularly scheduled
    programming...]
        --Larry Wall in Configure from the perl distribution
From: beaker@milton.u.washington.edu (Clint Olsen)
Newsgroups: comp.lang.perl
Subject: Problems installing perl 4.035 on Sun
Date: 21 Jul 92 21:32:28 GMT
Article-I.D.: u.1992Jul21.213228.3969
Organization: University of Washington, Seattle


Hello:

There doesn't seem to be any place to discuss problems installing
Perl.  If anyone can direct me to a newsgroup, please let me know.

I am getting failures when running "make test" on our Sun Sparc2
running SunOS 4.1.2.

They are on regexp, eval, and cpp.  Worse than that, after lib/big
I get a "Memory Fault (core dump)."

I find this troubling since I compiled this without too much trouble.

Any help would be appreciated.


-----------------------------------------------------------------------
Clint Olsen 
olsenc@maxwell.ee.washington.edu

Computers are like boats:  They are an endless pit to throw money into.
-----------------------------------------------------------------------
Newsgroups: comp.lang.perl
From: jerbil@ultra.com (Joseph Beckenbach {Adapter Software Release Engr})
Subject: Re: Commercial alternatives to perl?
Organization: Ultra Network Technologies
Distribution: usa
Date: Tue, 21 Jul 92 17:30:35 GMT

> I don't know of any other vendors who are shipping perl as part of
> their standard distribution.  

	Also add the latest release of Coherent (Mark Williams Co.),
according to the review in Byte (v17n8, August 1992, p. 37).  The reviewer
even cites the two derivations of Perl (Practical, and Pathologically :-).

		Joseph Beckenbach
-- 
----
Joseph Beckenbach	jerbil@ultra.com	408-922-0600 x246
	(speaking from, but not for, Ultra Network Technologies)
Democracy is apple pie:  you must make it before you enjoy it.  -- me
Newsgroups: comp.lang.perl