HDTenEightyP/NetNews huggingface dataset:
From: jfh@netcom.com (Jack Hamilton)
Subject: Re: How to run a Perl under DOS?
Organization: Netcom - Online Communication Services (408 241-9760 guest)
Date: Fri, 8 Jan 1993 07:14:50 GMT

In article <1268@alsys1.aecom.yu.edu> manaster@yu1.yu.edu (Chaim Manaster) asks how the foillowing script works: 

1  >>    @rem = '                   
2  >>    some dos batch commands
3  >>    PERL -S %0.BAT %1 %2 %3 (etc)
4  >>    GOTO ENDOFPERL
5  >>    ';
6  >>    # your perl script here
7  >>    __END__
8  >>    :ENDOFPERL
9  >>    some more DOS if you need it
10 >>    rem Drop through end of Batch file


I added line numbers to the left to make it easier to explain.

(1) is a valid statement in both perl and DOS batch.  In perl, it starts an
assignment statement which is finished in (5); in DOS, it's an unechoed
remark command. 

(2), which can be several lines, is just DOS commands.  When the file is
executed as a perl script, these commands are ignored, because they're
imbedded inside the string started in (1).  When the file is executed as a
batch file, they're executed (DOS doesn't know about continuations), so you 
can use them for setup or whatever. 

(3), like (2), is ignored in perl, but calls the perl interpreter in batch.
The -S options means "search the path for the script".  The "%0" expands to
the name of the file.  The remaining things are just parameters to be
passed to perl. 

(4) is ignored in perl, but in DOS it's a GOTO command pointing to (8).
The contents of (5)-(7) are perl commands, and probably won't be valid DOS
commands.  The GOTO just skips over them. 

(5) is skipped over when the file is executed as batch, but ends the
assignment statement started in (1) when executed as a perl script. 

(6) is any number of perl statements.   

(7) is a special perl statement.  It indicates that the end of the program
has been reached.  Perl will not treat anything after this line as a
program statement.  This example didn't show it, but you could put data
lines after (7), and read them from your perl program using the filehandle
DATA. 

Note that __END__ has a total of 4 underscores. 

(8) is interpreted only by DOS.  It's a label, and the object of the GOTO
in (4).  

(9) and (10) and just DOS commands. 


You do something similar using the -x command line  option instead of the -S
command line option. 


-- 

-----------------------------------------------------------------------
Jack Hamilton   jfh@netcom.com   P. O. Box 281107   SF, CA   94128-1107
Newsgroups: comp.lang.perl
From: ckd@eff.org (Christopher Davis)
Subject: Re: pattern matching
Organization: Electronic Frontier Foundation Tech Central
Date: Tue, 12 Jan 1993 21:25:33 GMT

HA> == Hans Aafloy <hans@symbas.UUCP>

 HA> I expexted the constructs /\d{1,1}/ or /\d{1}/ to match single digits
 HA> only, but it seems to match multiple digit numbers as well.

No, it's only *matching* the first one; the catch is that you haven't
anchored the search in such a way as to prevent it from matching a single
digit followed by another digit :)

 HA> My problem is trivial, and I know a couple of ways to get around
 HA> it, but since I'll use Perl a lot in the future, I want to get to
 HA> the bottom of things like this.

 HA> I simply want to insert a leading zero in front of a one digit date:
 HA> s/ *(\d{1})/0$1/;
 HA> and it replaces 88 with 088 as well as 8 with 08.

Try s/(\D)(\d\D)/$10$2/; though this doesn't have provision for the
beginning or end of a line (those are left as an exercise for the reader).
--
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>
Newsgroups: comp.lang.perl
From: cons@mercury.cern.ch (Lionel Cons)
Subject: Perl script started from inetd
Organization: CERN, European Research Center for Particle Physics
Distribution: comp
Date: Wed, 6 Jan 1993 11:24:45 GMT

Is it safe to start a script (especially a Perl script) from inetd ?
(by safe I mean that nobody can use the script to break my system)

If my script starts with #!, should I use '/path1/perl /path2/script'
or only '/path2/script' ?

What must I do to protect the script (signal handling, error
handling...) ?

Thanks for your help.
--

Lionel Cons

+------- CERN - European Laboratory for Particle Physics -------+
| E-mail: cons@dxcern.cern.ch                                   |
| Earth-mail: CN/SW/WS, CERN, CH-1211 GENEVE 23, Switzerland    |
| Phone: +41 22 767 49 13              Fax: +41 22 767 71 55    |
+---------------------------------------------------------------+
Newsgroups: comp.lang.perl,biz.sco.general
From: sl@wimsey.bc.ca (Stuart Lynne)
Subject: Re: Perl on SCO Open Desktop, SCO Unix 3.2v4
Organization: Wimsey Information Services
Date: Tue, 12 Jan 1993 08:27:28 GMT

In article <1993Jan12.011042.21430@promed.com.au> giles@promed.com.au (Giles Lean) writes:
>3. Binary for FTP
>
>There is a copy of a perl binary for SCO Unix available on ftp.wimsey.com
>under /pub/wimseypd -- I think this was made available by Stuart Lynne.
>I have no information on what this was compiled on, or whether it includes
>TCP/IP or crypt().

GCC, ODT 2.0 Dev Sys, TCP/IP yes, crypt() no.

-- 
Stuart Lynne <sl@wimsey.com> ......................... UNIX Facsimile Software
Wimsey Information Technologies ................... moderator biz.sco.binaries
uucp login:nuucp passwd:nuucp .................... ftp.wimsey.com:~ftp/ls-lR.Z
PD Software for SCO UNIX .................... ftp.wimsey.com:~ftp/pub/wimseypd
Newsgroups: comp.lang.perl
From: tm@mentor.dk (Tonny Madsen)
Newsgroups: comp.lang.perl
Subject: Re: Makefile parsing (challenge)
Date: 11 Jan 1993 11:30:53 +0100
Organization: Mentor Informatik, Denmark
NNTP-Posting-Host: bach.mentor.dk

Kevin Burton <noran!iowa!kburton@uunet.uu.net> writes:

>I want to extract certain variables defined in a makefile.

The easiest way to parse a makefile, is to let make do the parsing!!!

Try something like the following (please note that none of these
fragments have been tested!):

    TMPFILES=${TMPDIR:-/tmp}/t.$$.
    trap 'rm -rf ${TMPFILES}*' 0
    echo '.printSOURCES:; echo "$(SOURCES)"' > ${TMPFILES}mk
    make -f ${makefile} -f ${TMPFILES}mk .printSOURCES:

(This is comp.lang.perl, I know, and it shouldn't be that difficult to
perlify this.)

Some make's even let you do:

    TMPFILES=${TMPDIR:-/tmp}/t.$$.
    trap 'rm -rf ${TMPFILES}*' 0
    echo '.printSOURCES:; echo "$(SOURCES)"' |
    make -f ${makefile} -f - .printSOURCES:

Note that not all make's implements multiple use of the f option. If
none of the above examples work, then try:

    TMPFILES=${TMPDIR:-/tmp}/t.$$.
    trap 'rm -rf ${TMPFILES}*' 0
    echo '.printSOURCES:; echo "$(SOURCES)"' > ${TMPFILES}mk
    cat ${makefile} >> ${TMPFILES}mk
    make -f ${TMPFILES}mk .printSOURCES:

-- tonny
-- 
-----
Tonny Madsen, Mentor Informatik a/s, Fredens Torv 6, DK-8000 Arhus C, Denmark
telephone: +45 86 20 13 33 telefax  : +45 86 13 01 33
e-mail   : tm@mentor.dk
From: peter@micromuse.co.uk (Peter Galbavy)
Newsgroups: comp.lang.perl
Subject: Problems with "-s" in #! line - help !
Date: 6 Jan 93 12:59:10 GMT
Organization: MicroMuse Limited, London, England.

OK. If this is fixed in 4.035 sorry.

I have a script (well about 10) that I want to use the -s option with
just to pickup things like -debug etc.

If the #! line reads:

#!/usr/local/bin/perl -s

All is OK'ish. But then add a comment for emacs:

#!/usr/local/bin/perl -s        # -*- Perl -*-

and perl bombs out with:

"Unrecognized switch: - # -*- P."

I tried adding a "--" as well, and get:

"Unrecognized switch: - -- # -*."

Is this a bug or have I compiled perl wrong ?

Thanks all,
-- 
Peter Galbavy
Tech Support, Micromuse Ltd
Phone: +44 71 352 7774		E-Mail: P.Galbavy@micromuse.co.uk
From: 445362@llnl.gov (Grant Johnson)
Newsgroups: comp.lang.perl
Subject: Re: Perl mode for emacs?
Date: 13 Jan 93 01:06:10 GMT
Reply-To: 445362@llnl.gov
Organization: Lawrence Livermore National Lab

In article PNNTEST@pucc.Princeton.EDU, TDTRUE@pucc.Princeton.EDU writes:
>Anyone know of a perl mode for emacs?  C mode doesn't do the trick ...
> 
>Thanks for any help.
> 
> 
>Tom True
>Princeton University
>CIT - Advanced Applications
>TDTRUE@PUCC.PRINCETON.EDU
>(609) 258-6064


I asked the same thing recently...  Take a look in the perl source directory.  There is an emacs dir with perl-mode.el

If you have trouble locating it, let me know and I'll mail it to you.

---

Grant Johnson                                 Internet: grantj@llnl.gov
Lawrence Livermore National Lab	           PacBell Net: (510) 423-0406


Newsgroups: comp.lang.perl
From: jfh@netcom.com (Jack Hamilton)
Subject: Re: How to run a Perl under DOS?
Organization: Netcom - Online Communication Services (408 241-9760 guest)
Date: Mon, 11 Jan 1993 06:23:12 GMT

In article <1272@alsys1.aecom.yu.edu> manaster@yu1.yu.edu (Chaim Manaster) 
writes:
>>>>1  >>    @rem = '                   
>>>>2  >>    some dos batch commands
>>>>3  >>    PERL -S %0.BAT %1 %2 %3 (etc)
>>>>4  >>    GOTO ENDOFPERL
>>>>5  >>    ';
>>>>6  >>    # your perl script here
>>>>7  >>    __END__
>>>>8  >>    :ENDOFPERL
>>>>9  >>    some more DOS if you need it
>>>>10 >>    rem Drop through end of Batch file
>
>I am still very confised on this one. If my batch file is named
>"howdy" and my DOS command line is: Howdy firstname lastname, then
>firstname gets passed to %1 and lastname gets passed to %2. Then,
>when Perl is activated it passes %1 and %2 to @ARGV. Where do the
>single quotes youtalk about come into the picture? Also if  there
>were no single quotes (no matter where they come from) would Perl
>then do an expansion as well?

The quotes just make 1-5 a literal to perl.  When perl is called, it isn't
called as "perl howdy.bat %1 %2", it's called as "perl howdy.bat firstname
lastname" - the arguments have already been expanded by DOS.  If there were
no quotes of any kind, the whole thing would blow up.  If there were double
quotes, perl would (I think) try to interpret %1, etc as associative
arrays.  It still works, but it seems to take a little longer. 

-- 

-----------------------------------------------------------------------
Jack Hamilton   jfh@netcom.com   P. O. Box 281107   SF, CA   94128-1107
From: hans@symbas.UUCP (Hans Aafloy)
Newsgroups: comp.lang.perl
Subject: pattern matching
Date: 12 Jan 93 17:48:59 GMT
Reply-To: hans@symlab.UUCP ()
Organization: Symbiotic Computer Systems A/S, Trondheim, Norway

I expexted the constructs    /\d{1,1}/  or /\d{1}/
to match single digits only, but it seems to match multiple digit
numbers as well.
My problem is trivial, and I know a couple of ways to get around
it, but since I'll use Perl a lot in the future, I want to get to
the bottom of things like this.

I simply want to insert a leading zero in front of a one digit date:
s/ *(\d{1})/0$1/;
and it replaces 88 with 088 as well as 8 with 08.


Thanx for any hints.

Hans
From: tal@Warren.MENTORG.COM (Tom Limoncelli)
Newsgroups: comp.lang.perl
Subject: Re: online-manuals with perl anywhere?
Date: 8 Jan 1993 22:31:15 -0500
Organization: Mentor Graphics -- IC Group
NNTP-Posting-Host: sdl.warren.mentorg.com

In <1756@airgun.wg.waii.com> dwaddell@ipxpress.aws.waii.com (Operator) writes:

>From the Index on ashley.cs.widener.edu [147.31.254.132]
> * tchrist-man.shar.Z   Tom Christiansen's man set in perl (GREAT)

...also known as, "The Answer To All Man's Problems".

You gotta love it.

Tom
-- 
Tom Limoncelli -- tal@warren.mentorg.com (work) -- tal@plts.uucp (play)

Unix is a trademark of, WHATT????
Newsgroups: comp.lang.perl
From: vhc@abacus.hgs.se (Mikael Larsson)
Subject: Re: Wanted: script for mailstat
Organization: Solace Computer Club, Sundsvall, Sweden
Date: Tue, 12 Jan 1993 09:58:21 GMT


Hello!

I would like something looking like this: 

	User		Rcdv Mail		User		Sent Mail
	-----------------------------------------------------------------
	Mikael Larsson	   49			Mikael Larsson	   83
	Guest User	   47			Hacks Admin	   73
	Hacks Admin	   23			Operator	   32
	
etc etc

I've already tried your script.. :)


MiL

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Mikael Larsson         Phone: +46-26 275740          Email: vhc@abacus.hgs.se
Virus Help Centre      Fax:   +46-26 275720              or   : mikael@vhc.se
Authorized McAfee Associates Agent     FidoNet: 2:205/204 - VirNet: 9:461/101
Newsgroups: comp.lang.perl
From: cgf@ednor.bbc.com (Chris Faylor)
Subject: SCO Open Desktop
Organization: Boston Business Computing, Ltd.
Date: Sun, 10 Jan 1993 05:06:26 GMT

Ok.  This is the first time I've ever had one of those "I compiled
perl under <insert system here> and now it fails a test" problems.
Perl compiles and links but the following command from the tests
loops forever:

	perl -e 'goto foo;'

or at least for a very long time.  Any ideas where I should start
looking?  I tried compiling with no optimization whatever and still
got the same result.

I'd appreciate any help anybody can provide.
-- 
Chris Faylor		Boston Business Computing, Ltd.
cgf@ednor.bbc.com	"I am not here."
From: rutt@paradise.mti.sgi.com (John C. Ruttenberg)
Newsgroups: comp.lang.perl
Subject: X interface for perl programs
Date: 4 Jan 93 18:48:22 GMT
Reply-To: rutt@sgi.com
Organization: Silicon Graphics Inc.
NNTP-Posting-Host: 192.102.101.1

Has anyone made a GUI "toolkit" that perl programs can use?  The best thing
would be simple enough to use in trivial little perl programs and would make a
certain class of users pretty happy.
-- 

                                      John Ruttenberg -- (203) 874-7154
Newsgroups: comp.lang.perl
From: michael@nuchat.sccsi.com (Michael Bentley)
Subject: print/printf broken ?
Organization: South Coast Computing Services, Inc.
Date: Thu, 7 Jan 1993 04:52:40 GMT


	I just installed perl-4.035 on a Sun IPX running SunOS 4.1.2.  
The print and printf functions seem to be broken.  I have rebuilt 
perl several times (double checking everything before answering 
the questions posed by configure) - and print *still* only seems to
want to print to a tty device (Printing to stdout is just fine - I 
can even redirect to /dev/console ---- but I *cannot* redirect 
output to a file or a pipe (no error, it just don't do nuthin...)).

	I have found a workaround - assigning the value of a sprintf()
call to a scalar variable, and using system("echo $scalar_variable");
but I *REALLY* want to use printf FILEHANDLE instead!  BTW, write() 
works just fine - and I am really perplexed....

	Has anyone else run into something similar (perhaps the *same*
problem) ???  If so, pray tell me how you solved it...

		ADVthanxANCE,
		michael

-- 
+==========================================================================+
|  Michael Bentley (Life would be so much easier if I had the source code) |
|  VoiceNet : (713) 558-8410                                               |
|  E-mail   : michael@nuchat.sccsi.com                                     |
Newsgroups: comp.lang.perl,biz.sco.general
From: giles@promed.com.au (Giles Lean)
Subject: Re: Perl on SCO Open Desktop, SCO Unix 3.2v4
Organization: Pro Medicus, Melbourne, Australia
Date: Tue, 12 Jan 93 01:10:42 GMT

cgf@ednor.bbc.com (Chris Faylor) writes:

[Discussion of test 61 of big.t failing deleted.]

A progress report of my own experiences -- I asked for help a little while
back.  To those who said 'me too' you are not forgotten, at least yet!

I too have big.t failing test 61, and isolated this to a shift
of @x, where @x = ("+", "0") which returns "0" rather than "+".
The problem seemed related to a local(*x) earlier.

Given a tip by a guru of the internals, I'd take a look.  Given
my presently limited time this probably isn't worth it, and I'll
go with (2) below.

1. SCO and Configure

There appear to be a number of things that are in /lib/libc.a that
are not in /lib/libc_s.a.  I told Configure to link with -lc_s but that
the standard C library is /lib/libc.a.

Does anyone have a set of one-line descriptions for all the supplied
libraries?  There look still to be things for mixed memory models,
which I think are only required for producing MS DOS binaries.

2. Perl and GNU CC is OK

Other people have reported compiling perl with gcc.  I havn't done this
yet.  (The example config.sh files I've seen were missing quite a few
features, and I'd like to work on that.)

3. Binary for FTP

There is a copy of a perl binary for SCO Unix available on ftp.wimsey.com
under /pub/wimseypd -- I think this was made available by Stuart Lynne.
I have no information on what this was compiled on, or whether it includes
TCP/IP or crypt().

There is often more discussion of GNU software on SCO Unix and OpenDesktop
in biz.sco.general, for those of you who see the biz.* groups.
-- 
Giles Lean at Pro Medicus	<giles@promed.com.au>
From: matomira@di.epfl.ch (Fernando Mato Mira)
Newsgroups: comp.lang.clos
Subject: Re: Metaclass inheritance?
Date: 11 Jan 93 17:56:28 GMT
Organization: Ecole Polytechnique Federale de Lausanne

In article <DAVIS.93Jan11113652@passy.ilog.fr>, davis@passy.ilog.fr (Harley Davis) writes:
> 
> The workaround is to define your own class
> definition macro for your metaclass which could be just like DEFCLASS
> but inserts its own metaclass in the :METACLASS option.
> 
The idea is never having to define a new DEFCLASS-like macro, but use the
MOP instead for your customizations.

-- 
Fernando D. Mato Mira
Computer Graphics Lab			   "Bury GIFs!! Get JPEGed!!!"
Swiss Federal Institute of Technology
matomira@di.epfl.ch

NeXTMail : matomira@lignext.epfl.ch
FAX 	 : +41 (21) 693 - 5328
Newsgroups: comp.lang.clos
From: john@linus.mitre.org
Subject: MOPery
Organization: The Ohio State University Department of Computer and Information Science
Date: Tue, 12 Jan 1993 17:18:10 GMT

Fernando Mato Mira (matomira@di.epfl.ch) writes:

  The idea is never having to define a new DEFCLASS-like macro, but
  use the MOP instead for your customizations.

In my applications, there many things I could do more straight-
forwardly with the MOP than, say, a DEFINE-FOO-CLASS macro.
Nonetheless, I've been limiting my meta-CLOS programming, mostly
because of concerns about portability.

I know that SOME meta-object protocol is a semi-standard among SOME
vendors.  Is the MOP outlined in "The Art of ..." exactly the one
they've agreed to?  If not, is the agreed-upon MOP delineated
anywhere?  Whatever they've AGREED to, do they actually support all of
it?  Finally, which vendors do and do not support it?

Please post responses to the group, as I think this is a subject of
general interest.

Thanks.

John Burger
john@mitre.org
From: matomira@di.epfl.ch (Fernando Mato Mira)
Newsgroups: comp.lang.clos
Subject: Re: Metaclass inheritance?
Date: 11 Jan 93 10:04:30 GMT
Organization: Ecole Polytechnique Federale de Lausanne

In article <GREGOR.93Jan8173751@tracer-bullet.parc.xerox.com>, gregor@parc.xerox.com (Gregor Kiczales) writes:
> 
> This is a nice hack, and it is probably good enough to get some work
> done, but I guess I should point out that it is illegal, in portable
> code, according to the rules on pages 142, 143 and 144 of AMOP.
> Specifically the rule that:
> 
>   Any method defined by a portable program on a specified generic
>   function must have at least one specializer that is neither a
>   specified class nor an {\bf eql} specializer whose associated
>   value is an instance of a specified class.
> 
> The basic problem with methods like this is that two programs, written
> separately, which both have methods like this, will interfere with each
						      ^^^^^^^^^
> other if they are loaded together.  That is why this rule is there.  We

That's why I didn't like using an :around method. Now you know what I meant
when I said that "ENSURE-CLASS-USING-CLASS is not great to specialize".
Maybe specifying that the last action performed by ENSURE-CLASS-USING-CLASS is to call another function with the
same lamdba list, say FINALIZE-ENSURE-CLASS-USING-CLASS, (&allow-other-keys poses a problem for termination, so a
recursive call is out) but passing the newly created class as the class argument, and allowing to use CHANGE-CLASS in
this procedure would solve the problem.
One could see the class being defined as being "forward referenced" until DEFCLASS returns to avoid feeling "guilty" for allowing another exception to
the CHANGE-CLASS rule for class metaobjects.

-- 
Fernando D. Mato Mira
Computer Graphics Lab			   "Bury GIFs!! Get JPEGed!!!"
Swiss Federal Institute of Technology
matomira@di.epfl.ch

NeXTMail : matomira@lignext.epfl.ch
FAX 	 : +41 (21) 693 - 5328
From: gregor@parc.xerox.com (Gregor Kiczales)
Newsgroups: comp.lang.clos
Subject: Re: Automatic evaluation of expression in CLOS slots
Date: 4 Jan 93 17:40:44 GMT
Followup-To: comp.lang.clos
Organization: Xerox Palo Alto Research Center



  In article <1993Jan3.023306.25733@cc.umontreal.ca> kardank@ERE.UMontreal.CA (Kardan Kaveh) writes:

  I would like to be able to place expressions in class slots, and have them
  transparently evaluated when accessed.  Is there a standard way of doing
  this?  Do I need the Meta Object Protocol for this?


  And then, in article <1i7g64INN2tt@early-bird.think.com> barmar@think.com (Barry Margolin) writes:

  To get precisely what you described in your example, you need the MOP.

  If you're willing to allow SLOT-VALUE to return the expression, but have
  SLOT-1 perform the computation, you can do this without the MOP.  You could
  write...

  I think this should be sufficient, since functions outside the class should
  not use SLOT-VALUE instead of the accessor function.


I want to make a brief comment about this, having to do with how I think
one should go about making this decision.  That is, how does one decide,
for a given application, whether the approach proposed by Barmar is good
enough or whether one wants to use the MOP to change the behavior of
slot-value.

I believe the way to think about this is to enumerate to yourself all
the different `calls' to slot-value there are, and decide whether you
want all of those calls to perform the special action (i.e. evaluate the
form) or whether it is ok for some of them just return the value in the
slot.  The key point is that the calls to slot-value that come from
calling an accessor are not the only calls to slot-value -- various
environment tools like inspectors (e.g. describe) also call slot-value.

So, if all you want is for calls to certain accessors (i.e. slot-1) to
perform the special action, Barmar's proposed solution works fine.  But,
it means that any other tool that just calls slot-value -- notably
describe and other kinds of inspectors -- won't perform the special
action, they will just return the raw value in the slot.  That may be
unnacceptable to you, and it is for cases where that is unnacceptable
that this part of the MOP is provided.  It really depends on what you
want. 

Gregor
Newsgroups: comp.lang.clos,comp.lang.smalltalk,comp.lang.c++,comp.lang.objective-c,comp.lang.lisp,comp.lang.scheme