HDTenEightyP/NetNews huggingface dataset:
From: rich@apricot.co.uk (Richard Jones)
Newsgroups: comp.lang.perl
Subject: Re: 4.35: 3 Tests fail with SCO 3.2.2
Date: 16 Nov 92 17:09:22 GMT
Organization: Apricot Computers Limited

ado@ibg1.ibg.sub.org (Christoph Adomeit) writes:

>Hi Freaks, 
>my perl 4.19 works absolutely fine, but now i compiled V 4.35.

>I tried all variations of using Perl-malloc or not, different libraries ...
>But I always get 3 errors when i do a "make test" :
>op/goto hangs forever, when i run it individually i get msgs until
>	ok-2 and then it hangs.
>op/regexp hangs until "ok 44" and
>op/stat runs until the end, but gives an error on "4" :
>721683142 != 721683144.

>Do these errors have something to do with Byte-Alignments ? What else
>might be the reason. I also had the problem before, that Perl was
>dumping core right after startup. But by runncing Configure and make again 
>and again afterwards id worked.

I have all but op/dbm running successfully with 3.2v4.1, though I did
have a problem with goto and regexp after letting Configure do it it's
way.

I will mail out the config.sh I'm using on request, if it will help.

>Hope somebody could help me
>Bye
>	Christoph

>-- 
>Origin: It's not a bug, it's a feature !
-- 
 _ __            Apricot Computer Limited    Tel:   (+44) 21 717 7171
' )  )      /    3500 Parkside               Fax:   (+44) 21 717 0123
 /--' o _. /_    Birmingham Business Park
/  \_<_(__/ <_   BIRMINGHAM  B37 7YS         Email: richardj@apricot.co.uk
Richard Jones    United Kingdom                     ..!uknet!apricot!richardj
Newsgroups: comp.lang.perl
From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
Subject: Re: Non blocking open of FIFO: Can it be done in perl?
Keywords: O_NDELAY in open on a FIFO
Organization: Motorola Codex, Canton, Massachusetts
Distribution: usa
Date: Fri, 20 Nov 1992 22:13:03 GMT

les@chinet.chi.il.us (Leslie Mikesell) writes:

>In article <mcook.722100624@fendahl.dev.cdx.mot.com> mcook@fendahl.dev.cdx.mot.com (Michael Cook) writes:
>>bmarlowe@ka.reg.uci.edu (Brett Marlowe) writes:
>>
>>>is the there a way to specify O_NDELAY on an open call?
>>
>>No, but you can tweak the filehandle afterwards.  See fcntl.

>Ummm, afterwards won't ever come if there isn't another process on
>the other end of the FIFO.

Oh, right.  Silly me.

I suppose you could use syscall() instead of open(), and then use
open(FH,">&$fd") on the resulting file descriptor.

Michael.
From: wnw@hpfcso.FC.HP.COM (Bill Weiner)
Date: Thu, 19 Nov 1992 19:35:30 GMT
Subject: Re: How to output % symbol in perl
Organization: Hewlett-Packard, Fort Collins, CO, USA
Newsgroups: comp.lang.perl

In comp.lang.perl, donghao@leland.Stanford.EDU (dong hao zhang) writes:

> Suppose we run a file like the following:
> 
> #! /usr/pubsw/bin/perl
> printf STDOUT "\% A Latex Picture. \n";
> 
> The output of the above file is:
> A Latex Picture. 
> instead of the desired: % A Latex Picture.
> 
> Any idea why the backslash does not protect the % symbol from 
> being interpreted ? And how may I output the % symbol with a perl script?
>  
> Thanks for any help.
> 
> Dong Hao Zhang                         donghao@leland.stanford.edu

 printf STDOUT "%% A Latex Picture. \n";

works for me.

Bill Weiner
wnw@hpeswnw.fc.hp.com

Newsgroups: comp.lang.perl
From: asherman@fmrco.com (Aaron Sherman)
Subject: Solution to the "@x{...} = (1) x 1000" problem
Reply-To: asherman@fmrco.COM
Organization: I-Kinetics, 19 Bishop-Allen Dr., Cambridge, MA
Date: Wed, 18 Nov 1992 16:40:24 GMT


I think that I have a solution to the problem of wanting to fill an
array with a uniform initial value, ie:

	@x{grep(</usr/local[0-9]/*>)} = (1) x 1000

The method above will work (as long as there are 1000 or less
/usr/local<n>/* files, but memory is wasted, and an assumption has
to be made. My solution would be this:

	@x{...} = replicate(1);

"replicate" is a function that takes ONE argument, and creates a dummy
array which actually has no length. No matter what element of the
array you look up, you get the scalar value that is passed to
replicate.

The problem is that this needs a new way of dealing with assignment.
For instance:

	@x = replicate(1);

would set $#x to what? I would suggest that it assign as many elements
as the array currently contains, or one by default. This way the
initial purpose is preserved.

Can this be done? Easily? Any chance of seeing it in perl5?

Thanks.


			-AJS

--
--------
Disclaimer: I am solely responsible for the content of this message.
The views expressed here may not be the views of I-Kinetics, Fidelity,
any of the Fidelity-owned corporations or my mother.
Newsgroups: comp.lang.perl
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Subject: Re: Regex question
Organization: Loral Western Development Labs
Date: Mon, 23 Nov 1992 17:10:17 GMT

In article <1ejsonINNeal@fido.asd.sgi.com> cwilson@snarf.wpd.sgi.com (Chan Wilson) writes:
>
>I thought I knew how to do this... guess I don't.  I want to have
>something like this:
>
>($suit, $pip) = /(\S+) of (Spade|Heart|Club|Diamond)/;
>
>but that doesn't work.  What will?

Works fine for me on a sun-3 version 4.035.  You did get $suit and $pip
backwards, so when $_ = "ten of Heart"; I get $suit eq "ten" and 
$pip eq "Heart", but it worked.

--
Perl's Maternal Uncle
Mark Biggar
mab@wdl1.wdl.loral.com
From: Eric-Amick@cup.portal.com (Richard E Amick)
Newsgroups: comp.lang.perl
Subject: Re: perl on Alpha AXP
Date: Sat, 21 Nov 92 12:43:50 PST
Organization: The Portal System (TM)
Distribution: usa
  <1ej1lhINNkln@warren.mentorg.com>

>Reality is stranger than fiction #943247:  The IRS granted
>ANS approval as a 501c3 "charity" on September 14, 1992.

Cute, but 501(c)(3) also permits tax exemptions for religious,
educational, and scientific organizations as well.  I think cultural
organizations are included, but I'm not sure.
Newsgroups: comp.lang.perl
From: sjaak@athena.research.ptt.nl (Sjaak Schilperoort)
Subject: Re: MSDOS Perl
Originator: sjaak@athena.research.ptt.nl
Reply-To: J.W.Schilperoort@research.ptt.nl
Organization: PTT Research
Date: Wed, 18 Nov 1992 19:49:02 GMT

rahardj@ccu.umanitoba.ca (Budi Rahardjo) writes:

>g92k4260@ru.ac.za (Bryan Kilian) writes:

>>This may be a FAQ and I apologise if it is, but is there a version of perl
>>that will run on a PC/XT? I would love to be able to use my Perl programs on
>>my PC but I'm not sure if it's possible.

>Try  ftp.ee.umanitoba.ca:/pub/msdos/perl

This is in the perl FAQ.  But how about a curseperl for MSDOS?  It's
not mentioned in the FAQ.  I've asked before but didn't receive any
answer. This means that no one said it's not possible either so I'm 
still having hope ...

			Sjaak.
-- 
Sjaak Schilperoort                   J.W.Schilperoort@research.ptt.nl
PTT Research, The Netherlands
From: Eric-Amick@cup.portal.com (Richard E Amick)
Newsgroups: comp.lang.perl
Subject: Re: How to output % symbol in perl
Date: Thu, 19 Nov 92 16:48:20 PST
Organization: The Portal System (TM)
Distribution: usa

>Suppose we run a file like the following:
>
>#! /usr/pubsw/bin/perl
>printf STDOUT "\% A Latex Picture. \n";
>
>The output of the above file is:
>A Latex Picture. 
>instead of the desired: % A Latex Picture.
>
>Any idea why the backslash does not protect the % symbol from 
>being interpreted ? And how may I output the % symbol with a perl script?

printf uses the same format string conventions as the C library
function; if you consult the man page, you'll see that you need:

printf STDOUT "%% A Latex Picture. \n";

While we're at it, this works just as well:

print "% A Latex Picture. \n";

Remember that STDOUT is the default filehandle for print, and you're not
doing any formatting.

Eric
From: tal@Warren.MENTORG.COM (Tom Limoncelli)
Newsgroups: comp.lang.perl
Subject: Re: How to output % symbol in perl
Date: 20 Nov 1992 17:10:33 -0500
Organization: Mentor Graphics -- IC Group
Distribution: usa
NNTP-Posting-Host: milk.warren.mentorg.com

In <MEISSNER.92Nov20150830@curley.osf.org> meissner@osf.org (Michael Meissner) writes:

>Though of course:

>	print "%A Latex Picture.\n";

>will NOT print what is intended, since perl will expand the %A array
>into a string.

What version of Perl are you using?

DB<6> $A{'bar'} = 'foo';

DB<7>         print "%A Latex Picture.\n";
%A Latex Picture.


Tom
-- 
Tom Limoncelli -- tal@warren.mentorg.com (work) -- tal@plts.uucp (play)
Reality is stranger than fiction #943247:  The IRS granted
ANS approval as a 501c3 "charity" on September 14, 1992.
Newsgroups: comp.lang.perl
From: Laszlo.Herczeg@nautical.r-node.gts.org (Laszlo Herczeg)
Date: Sun, 22 Nov 92 16:36:12 EST
Organization: R-node Public Access UNIX Information System (416-249-5366)
Subject: perl and Post Script
Distribution: world
Reply-To: Laszlo.Herczeg@nautical.r-node.gts.org (Laszlo Herczeg)
X-Posting-Software: UniBoard 1.10a S/N 120921

Helthere!
 I am a budding Perl user and I have the following question:
Could someone suggest a script which converts Post Script files into
simple ASCII format, stripping the formatting characters and the
brackets?
 
I have already removed the formattimg characters with:
 
perl -lne "/(\(.+\))/$$ print $1 las.doc > good.doc
 
What I need now is to remove the () round brackets and the end of line
characters which Post Script uses. (Sorry, I have no idea what they
might be).
 Also, there are special shorthands in Post Script, such as 256 for FI,
as in "256les", which translates into "files". How do I render those
back into normal characters?
 
 Many thanks for considering this request!
Laszlo Herczeg
--
Laszlo Herczeg, user of the UniBoard System @ r-node.gts.org
E-Mail: Laszlo.Herczeg@nautical.r-node.gts.org


R-node Public Access Unix/BBS - Free Access to the World thru Usenet
                 Data: 1-416-249-5366 (3 Lines)
     Shell Accounts Available - Contact marc@r-node.gts.org
From: markd@werple.apana.org.au (Mark Delany)
Newsgroups: comp.lang.perl
Subject: Re: Perl 5 (was Questions on Perl Source Code.)
Date: 20 Nov 1992 16:00:24 +1100
Organization: werple public-access unix, Melbourne
NNTP-Posting-Host: werple.apana.org.au

lwall@netlabs.com (Larry Wall) writes:


>Besides, it'd all be obsolete now anyway.  Perl 5 doesn't even have
>str.c or eval.c!

> ...

>The ideal in a language like Perl is that scalars always look like
>strings to the casual observer, with numeric optimizations occurring
>internally.  Though it doesn't currently, Perl 5's compiler could
>easily analyze return types and arguments to see where integers can be
>substituted for doubles.  Perl 4's compiler simply can't do this,
>because it needlessly defers too many decisions to run-time.  It's
>one of the reasons I completely scrapped the old compiler.

Hmmm. Sounds to me like a separation of the compiler and interpreter.
Presumably with some sort of portable p-code.  Could it be that the
perl object (*.plo is a natch) becomes some sort of de facto
Architecture Neutral Binary Format?



--
Mark Delany                                          markd@werple.apana.org.au
Newsgroups: comp.lang.perl
From: mcook@fendahl.dev.cdx.mot.com (Michael Cook)
Subject: Re: Multi-dimensional arrays
Organization: Motorola Codex, Canton, Massachusetts
Date: Wed, 18 Nov 1992 15:27:08 GMT

sasswb@unx.sas.com (Scott Bass) writes:

>1.  How can I code a multi-dimensional array in perl, say an Nx5 array?

You can do it the same way you could in any language:

	$foo[$i * 5 + $j] = $bar;

Michael.
Newsgroups: comp.lang.perl
From: meissner@osf.org (Michael Meissner)
Subject: Re: How to output % symbol in perl
Organization: Open Software Foundation
Distribution: usa
Date: 20 Nov 92 15:08:30

In article <69857@cup.portal.com> Eric-Amick@cup.portal.com (Richard E Amick) writes:

| print "% A Latex Picture. \n";

Though of course:

	print "%A Latex Picture.\n";

will NOT print what is intended, since perl will expand the %A array
into a string.
--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

You are in a twisty little passage of standards, all conflicting.
dov
From: dov@menora.weizmann.ac.il (Dov Grobgeld)
Newsgroups: comp.lang.perl
Subject: Re: sorting problem
Date: 15 Nov 92 14:10:16 GMT
Organization: Weizmann Institute of Science, Computation Center.

tchrist@convex.COM (Tom Christiansen) writes:
: :
:
:     for (@data) { push(@idx, /^[^;]*;(.*)/) }
                                ^^^^^^^^^^^^
According to the book m// returnes true (1) or false (''). So I guess
that the expression should really be

     for (@data) { push(@idx, (/^[^;]*;(.*)/, $1)) }

or

     for (@data) { /^[^;]*;(.*)/ && push(@idx, $1) }

or perhaps

    @idx=@data && grep( s/^[^;]*;(.*)/$1/, @idx);

--
                                                        ___   ___
                                                      /  o  \   o \
Dov Grobgeld                                         ( o  o  ) o   |
The Weizmann Institute of Science, Israel             \  o  /o  o /
"Where the tree of wisdom carries oranges"              | |   | |
                                                       _| |_ _| |_
Newsgroups: comp.lang.perl
From: weingart@inf.ethz.ch (Tobias Weingartner)
Subject: DBM stuff random?
Followup-To: comp.lang.perl
Keywords: DBM
Reply-To: weingart@inf.ethz.ch
Organization: ETH - Switzerland
Date: Wed, 18 Nov 1992 16:29:17 GMT

This one has me baffeld.  I have a piece of code,
that updates a dbm file (dbmopen....), and also
the ASCII version of this file.

The ASCII version gets updated with no problem.
The DBM version does not seem to get updated.

However, IF I DO the updating using the debugger
(perl -d) everything works.  I don't mean if I
step though the code, but if it type in:

perl -de 0

And then do the dbmopen(...);$FOO{...} = BAR;dbmclose(..);

If anyone can see where I have gone wrong in the following
excerpt, please pound me on the noggin.  I know, this ain't
pretty code, but I AM in the process of munging into something
a little better...

#
# Open and update ASCII file
#
        open(UDB, "<$udb_data") || return "Open $!.";
        chop(@udb = <UDB>);
        close(UDB);

        @udb = grep(!/^$user:/, @udb);
        push(@udb, join(':', @uinfo));

        open(UDB, ">$udb_data") || return "Open $! $udb_data.";
        for(@udb){
                print UDB "$_\n";
        }
        close(UDB);

#
# Open and update both DBM files.
#
        dbmopen(BYU, "$udb_by_u", undef) || return "Open $! $udb_by_u.";
        dbmopen(BYN, "$udb_by_n", undef) || return "Open $! $udb_by_n.";

        $BYU{$user} = join(':', @uinfo);		# Don't work, WHY???
        $BYN{$uinfo[1]} = join(':', @uinfo);	# Don't work, WHY???

        dbmclose(BYU);
        dbmclose(BYN);


I'm lost!

--Toby.

***************************************************************
* Tobias Weingartner  * Not every man is willing to die...    *                
* c/o Bruno Opprecht  * Some have to be PUSHED out the window *
* Oberdierikoner st.7 * ------------------------------------- *                
* 6030 Ebikon Luzern  *  Anybody who dictates that computers  *
* SWITZERLAND         *        are logical, I'll ...          *                
***************************************************************
* +41'041'33'25'40    * ..Midnight the fading, blue Wizrd..   *
***************************************************************
SYSTEM-F-ANARCHISM, the operating system has been overthrown                  

PGP2.0 Public Key available at 'finger weingart@tau.inf.ethz.ch'

Newsgroups: comp.lang.perl
From: mab@wdl39.wdl.loral.com (Mark A Biggar)
Subject: Re: cpp fails in statements like pkg'foo(DEFINE)
Organization: Loral Western Development Labs
Date: Wed, 18 Nov 1992 18:02:09 GMT

In article <BxvntG.61x@ibg1.ibg.sub.org> ado@ibg1.ibg.sub.org (Christoph Adomeit) writes:
>what is the golden way to prevent cpp from interpreting
>a statement like 
>#define DEFINE 99
>pkg'foo(DEFINE) 
>as a part of a string literal ?
>In the above examples DEFINE is not replaced by "99" because
>cpp thinks it's a string literal.
>-- 
>Origin: It's not a bug, it's a feature !

Unfortunately, a lot of CPPs out there insist on tokenizing their input as if
it was a C source file.  What did you expect, it's a C preprocessor and the
C standard specifically allows CPP to do this.  Of course, this means that
some CPPs cannot be used to preprocess Perl scripts, but it's only a
historical accident that the CPP on the machine Larry originally developed
Perl on had a CPP that could be used to preprocess Perl scripts.  That feature
was originally added to Perl very early to get the include file processing of
PCC, the #define stuff was only incidential.  Now that 'do' and 'require' have
been added to the language, the main reason for using CPP has gone away, and
it could be argued that CPP support should be dropped from the Perl interpreter
or a macro processor specifically designed for Perl should be created.  Note:
all these problems with CPP are some of the reasons why the ch2p tool converts
#define CPP lines into perl subroutines.

In answer to your question, No there is no way to tell your CPP to do things
the way you want.  Either find a different (probably older) CPP that works
your way or don't use CPP.

--
Perl's Maternal Uncle
Mark Biggar
mab@wdl1.wdl.loral.com

Newsgroups: comp.lang.perl
From: sasswb@unx.sas.com (Scott Bass)
Subject: Multi-dimensional arrays
Date: Tue, 17 Nov 1992 17:31:19 GMT
Organization: SAS Institute Inc.

I've got the Perl (Camel) book and have read it cover to cover, but I don't
remember it covering the above subject (I admit I haven't dug around in it
for this specific subject).

Sooooo . . .

1.  How can I code a multi-dimensional array in perl, say an Nx5 array?

2.  Can I do this with an associative array, i.e. have the key for the
associative array determine the row of the array?

3.  Can I load the array via a here document or lines after a __DATA__
token, i.e. from a "file"?

What I'm trying to do is set variables based on some command line
parameters.  I'd like to have an easy-to-maintain lookup table that sets
values based on command line switches.  In rather poor pseudo-code:

@array = <<EOF
'foo','parm1','parm2','parm3','parm4','parm5'
'bar','parma','parmb','parmc','parmd','parme'
EOF

where 'foo' and 'bar' are keys to the associative array.  Then:

while (shift) {
   p1 = $array($_,1);
   p2 = $array($_,2);
   p3 = $array($_,3);
   p4 = $array($_,4);
   p5 = $array($_,5);
}

or something like that.  I could probably optimize it further by using a
loop inside the while, but the above would get me started.

In summary, I want a single keyword command line parameter to trigger
several other options.  I want to maintain the relationships in a table
somewhere so I can just add or delete rows from the table to add new
command line switches, rather than digging thru the code adding logic.
Seems like NxM arrays would do the trick, but don't know how to code them.

In case it's not obvious, I'm new at perl (but really like it!!!)

Thanks for any help you can give.

------------------------------------------------------------------------------
Scott Bass                           |  SAS Institute Inc.
Integrated Systems, A216, x6975      |  SAS Campus Drive, Cary, NC  27513-2414
sasswb@k2.unx.sas.com                |  (919) 677-8001 x6975
------------------------------------------------------------------------------
From: kheldar@prism.gatech.EDU (Garner Halloran)
Newsgroups: comp.lang.perl
Subject: looking for FAQ
Date: 23 Nov 92 13:22:07 GMT
Organization: College of Computing - Georgia Tech

Could someone please direct me to the FAQ for this newsgroup (assuming it
exists)?  I checked news.answers and it was not listed at my site.

Thanks.
-- 
"A common mistake that people make when trying to design something completely
 foolproof was to underestimate the ingenuity of complete fools."
                                             - Douglas Adams, "Mostly Harmless"
Garner Halloran - kheldar@cc.gatech.edu
Newsgroups: comp.lang.perl
From: pshannon@iapetus.cv.nrao.edu (Paul Shannon)
Subject: novice question: how import many lines of command output
Organization: nrao
Distribution: comp
Date: Sun, 22 Nov 1992 18:21:46 GMT


I want to run a command from a perl program, grab the 12 or so lines
of output, and then manipulate those lines from within the perl program.
To be more explicit, the command (running under aix 3.2.2) is

           lsvg -l rootvg

and the results are:

rootvg:
LV NAME             TYPE       LPs PPs PVs  LV STATE      MOUNT POINT
hd5                 boot       2   2   1    closed/syncd  /blv
hd6                 paging     64  64  1    open/syncd    N/A
hd8                 jfslog     1   1   1    open/syncd    N/A
hd4                 jfs        1   1   1    open/syncd    /
hd2                 jfs        60  60  1    open/syncd    /usr
hd3                 jfs        2   2   1    open/syncd    /tmp
hd1                 jfs        1   1   1    open/syncd    /home
hd9var              jfs        11  11  1    open/syncd    /var
hd7                 sysdump    1   1   1    open/syncd    /mnt
hd10                jfs        28  28  1    open/syncd    /usr/sys/inst.images

I don't know how to read this output back into my program.  I've
looked through the Perl book, and I didn't see anything comparable.
Any tips?  Thanks.

 - Paul
From: bmarlowe@ka.reg.uci.edu (Brett Marlowe)
Subject: Re: Non blocking open of FIFO: Can it be done in perl?
Newsgroups: comp.lang.perl
Keywords: O_NDELAY in open on a FIFO
Distribution: usa
Date: 18 Nov 92 17:01:35 GMT

In <BxwD69.1IH@chinet.chi.il.us> les@chinet.chi.il.us (Leslie Mikesell) writes:

>In article <bmarlowe.722046368@ka> bmarlowe@ka.reg.uci.edu (Brett Marlowe) writes:

>>I'm using FIFO as a rendezvouz point between two entirely different
>>systems.  My question is... is the there a way to specify O_NDELAY on
>>an open call? Alternatively is there a way to make sure there is a
>>reader on the other end of the FIFO?

>At least on sysVish machines, opening a FIFO for read/write access
>is non-blocking.  As a side effect you won't ever see EOF even
>if the other processes open and close the fifo repeatedly, so reads
>will always wait for some data which is what you usually want for the
>case of one reader process acting as some kind of server to one or more
>writing process.

>Les Mikesell
>  les@chinet.chi.il.us

SunOS would seem to differ.  My implementation blocks on an open until
a reader starts up and the reader receives an EOF when I close.  What
I am trying to avoid is blocking on open when the reader has died/gone
away.

-Brett
--
-------------------------------------------------------------------------------
Brett Marlowe    |  University of California, Irvine
bmarlowe@uci.edu |  Office of the Registrar  (making sure you get your bills)
From: merklin@hal.gnu.ai.mit.edu (Ed Kemo)
Newsgroups: comp.lang.perl
Subject: perl script
Date: 23 Nov 92 16:07:40 GMT
Distribution: comp.lang.perl
Organization: /etc/organization

Hello!
I want to write a perl script which will allow me to pull up any text file
from 00000.txt to 99999.txt...currently I am not using perl but instead
using more [0-9].txt which handles all files with 5 digits just fine,
but I would like to be able to read any particular test case...
comments are welcome...
please email me at merklin@gnu.ai.mit.edu
ed