[10061] in Perl-Users-Digest
Perl-Users Digest, Issue: 3654 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 7 17:07:16 1998
Date: Mon, 7 Sep 98 14:00:17 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 7 Sep 1998 Volume: 8 Number: 3654
Today's topics:
Re: a better read()? <merlyn@stonehenge.com>
Re: Beginner in Perl and Tape problem <eashton@bbnplanet.com>
Re: changing the default shell for system and exec comm <J.D.Gilbey@qmw.ac.uk>
Re: changing the default shell for system and exec comm <nguyend7@msu.edu>
Re: chmod 755 from a cgi output KlausRusch@atmedia.net
Re: COBOL and Perl <d-edwards@nospam.uchicago.edu>
Re: flock behavior <JKRY3025@comenius.ms.mff.cuni.cz>
Re: fork problem: two children finishes at the same tim <rick.delaney@shaw.wave.ca>
Re: help with mail sending. KlausRusch@atmedia.net
Re: My cool DIRTTY PICS page <webmaster@fccjmail.fccj.cc.fl.us>
Perl Programmer Needed <Richard@WowMe.com>
Perl Source Needed <mhodge@netcom.ca>
Re: Perl Source Needed <J.D.Gilbey@qmw.ac.uk>
Please help with perl checkbox (NAME)
Re: Problem: Opening Word (ack!) doc w/ OLE <oscar@charpy.etsiig.uniovi.es>
Re: setuid CGI <webmaster@fccjmail.fccj.cc.fl.us>
SSI Problem (Sunni Leigh)
Re: user environment variable <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: What is the purpose of Perl <icephreak@lod.com>
Why the syntax Error? Code included... <Jabok@usa.net>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 07 Sep 1998 18:50:42 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: a better read()?
Message-Id: <8ck93frc3z.fsf@gadget.cscaper.com>
>>>>> "Sam" == Sam Wang <samwang@freewwweb.com> writes:
Sam> i'm talking about LENGTH. as i recall, you have to set this.
That's a *maximum* length. Set it to 1e10 if you don't mind
swallowing a lot on your first bite. You must have some idea of the
largest possible read, don't you?
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Mon, 07 Sep 1998 20:16:43 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Beginner in Perl and Tape problem
Message-Id: <35F43CCF.994D30D6@bbnplanet.com>
Gilles Bellaches wrote:
>
> Hi everybody,
> I just start to learn Perl because i use Tivoli on NT 4.0 SP3 French
> (yes, i am)
> My problem is this one :
> We would like to know if there is a tape in the Tape Device before we
> run the backup.
Well, in unix you could use mt to get a status on a tape drive. In NT, I
do believe you can use ntbackup to select a tape and get a status etc.
Also, I use Tivoli and there are a few functions which you may be able
to make use of via a Perl script.
e.
------------------------------
Date: Mon, 07 Sep 1998 20:41:28 +0100
From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: changing the default shell for system and exec commands
Message-Id: <35F436E8.1720B7DE@qmw.ac.uk>
aori wrote:
>
> Hi !
> does anyone know how ??????
> thanks Ori.
The Camel book specifies that the arguments of exec are passed
to '/bin/sh -c' if shell metacharacters are found.
I guess you could try something like
exec '/bin/csh -c "echo Hello"'
even though it's a bit yukky.
Julian
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Julian Gilbey Email: J.D.Gilbey@qmw.ac.uk
Dept of Mathematical Sciences,
Queen Mary & Westfield College,
Mile End Road, London E1 4NS, ENGLAND
------------------------------
Date: 7 Sep 1998 20:17:34 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: changing the default shell for system and exec commands
Message-Id: <6t1f0u$9qr$1@msunews.cl.msu.edu>
aori <aori@iil.intel.com> wrote:
: Hi !
: does anyone know how ??????
: thanks Ori.
the reason the system and exec commands use sh, is that it is on every
system. Shells like csh, ksh, tcsh and others may or may not be on
the sytem.
-dan
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Mon, 07 Sep 1998 20:06:57 GMT
From: KlausRusch@atmedia.net
Subject: Re: chmod 755 from a cgi output
Message-Id: <6t1ed1$q4r$1@nnrp1.dejanews.com>
In article <6srmo3$e74$1@nnrp1.dejanews.com>,
jeff2591@my-dejanews.com wrote:
> Can someone tell me how to make my cgi output
> created from:
> pring Content-type: text/html
> set to where i can use server side includes.
This question doesn't really belong here since it's a server configuration
problem, not a Perl one. For your server, see http://www.apache.org/ (you will
find that SSI is not supported with CGI scripts).
Klaus Johannes Rusch
--
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 7 Sep 1998 17:45:51 GMT
From: Darrin Edwards <d-edwards@nospam.uchicago.edu>
Subject: Re: COBOL and Perl
Message-Id: <tgr9xnx1dc.fsf@noise.bsd.uchicago.edu>
scm@enterprise.net (Shaun C. Murray) writes:
> >Well, I think that depends on the problem domain the language is
> >designed to handle. Again, I don't think this criticism is particular
> >to perl; similar arguments could be made about most computer languages,
> >mathematical notation, etc. Usually the symbols are not intended
> >to deceive or be "cryptic," but to make the commonly used "idioms"
> >of the language... what's the word I'm looking for... succinct.
>
> as I said, shorthand.
>
> >Silly e.g.: I don't think "a*b" is much more cryptic than "a times b,"
>
> But thats just for maths you're describing. There is a well known
> notation for that that's evolved over 100's of years.
So one might infer from the age and popularity of such notational
conveniences that notational conveniences are sometimes considered
useful.
[More on shorthand at end.]
> >If I say that I really don't understand whether "test-data" and
> >"data-rec" here are builtin operators, user-supplied functions, or
> >actual data chunks, I hope you won't think I'm being facetious.
>
> You're inferring your knowledge of other computer languages on the
> example. ie. you know about operators, user-supplied functions etc
> from other languages. Try just reading it as English.
[snip my guesses]
> Nope that's all it was doing and you had more than a vague idea. From not
> seeing any COBOL before, you know what the program segment was doing.
> Does that prove my point?
I said I didn't understand some of the constructs. You said "Try reading
it as English," and I still don't understand what some of the constructs are
or what they are meant to do. If your point was that the semantics
should be trivially extractable from the syntax, even for someone who
(like me) does not know the syntax, then I would have to say no. (Does
this prove my point, that even a "relatively simple" syntax does not
guarantee transparency of semantics?)
> > Is data-file the actual filename, or
> >is it a variable for a filename supplied elsewhere?
>
> In this case it wasn't explicit as I didn't include the File Section which
> defines the file. It isn't important to the understanding of the program -
> you understood it was a file.
Just as one might reasonably guess that a line of perl code like
$next_line = <DATA_FILE>;
was reading in another line of input from a data file.
> COBOL punctuation makes sense if you know English.
No; I know English, and didn't thoroughly understand your
example. COBOL punctuation makes sense if you know COBOL.
> >Seriously, let's
> >take a simple example: line-termination chars vs. line-continuation
> >chars.
> COBOL doesn't have line termination of line continuation characters except in
^^^^^^^^^^^^
> the case where you want to continue a long string. You stick a hyphen at the
> beginning of the next line.
[snip COBOL e.g.'s]
> > Since I don't see any of the former in your example, I'm gonna
> >guess that COBOL uses some punctuation to denote that a line is
> >continued on the next, i.e. that two or more lines of source code should
> >be treated as a "unit"
>
> See above. That's a wrong assumption. If I write a long sentance than
^^^^^^^^^^^^^^^^
> continues onto another line I can work out that it continues by parsing
> it. Why can't a computer?
>
> > E.g. in matlab you'd end the line with
> >an ellipsis (...), in FORTRAN you'd start the next line with a "*".
> >So it'd be unfair of me to criticize COBOL just for using
> >punctuation for this (COBOL's not alone in this)
>
> You're wrong.
^^^^^^^
So my _guess_ as to the semantics based only on a _limited knowledge_
of COBOL syntax from several lines of code was _wrong_. Good, that's
pretty much the point I was trying to make! :)
> >To sum up an already long post: I don't think this is a criticism
> >of perl per se (these features are shared by many languages).
> >While some problems might be readily, even preferably, tackled
> >using a very English-like language, for other problems this approach
> >can become at best tedious, at worst frustratingly complex.
>
> Speaking with my support programmer hat on - Keep It Simple Stupid -
> Simplification makes it much easier to understand other peoples code.
And simplification means different things in different problem
domains. Do you disagree that a notational convenience ("shorthand")
can be a simplification? Are your criticisms particular to perl?
> >> I don't want to learn shorthand as
> >> only people who know shorthand can read it.
> >Even if you needed to take lots+lots of notes realtime?
> >E.g. med school, legal secretary? :) IMHO it depends on what one's doing.
>
> I'm a programmer not a secretary. My shorthand is a collection of object
> frameworks, a growing repository and a searchable database of tried and
> tested code that I can understand years after I or someone else has
> written it.
[Back to shorthand]
I wasn't calling you a secretary. I was trying to point out examples
of problem domains in which shorthand could be useful. One person's
"shorthand" ("line noise" was where I jumped in this thread :))
is another's mission-critical tool.
Darrin
------------------------------
Date: Mon, 07 Sep 1998 19:51:31 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: flock behavior
Message-Id: <35F49BB3.1C59@comenius.ms.mff.cuni.cz>
Sam Wang wrote:
>
> i've looked thru man flock, llama and camel books, man perlfunc, but to
> no avail. can any one tell me if, when, flock will automatically
> flock(FILE, $LOCK_UN)? ie, i $LOCK_EX a filehandle. but if i don't
> $LOCK_UN it'll automatically unlock by the end of the script. now, does
> it automatically unlock after the explicit closing of the filehandle,
> the implicit closing of the filehandle, or at the end of the script?
If you close the file explicitly, it will unlock it.
If you do not, it will unlock it as soon as the handle comes out
of scope. Otherwise at the end of the script.
Anyway, you should close files as soon as you do not need them.
EXPLICITLY.
Otherwise when you will be reading the script after some time you will
not be sure if the file will or will not be used any more.
And it also consumes a few system resources without reason.
Jenda
------------------------------
Date: Mon, 07 Sep 1998 18:35:46 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: fork problem: two children finishes at the same time!
Message-Id: <35F42907.6C5982D1@shaw.wave.ca>
dwiesel@my-dejanews.com wrote:
>
> Hi again. I didn4t get any answer to this question... does that mean
> that nobody knows???
Probably. Impatience is a virtue of Perl programmers, so I'm sure that
any who could reply in less than 24 hours would do so--even if it is a
long weekend.
> I would really appriciate every answer... // Daniel
That's good, because many wouldn't appreciate this one.
Btw, I'm not holding out on you. If I knew how to answer your question,
I would. Perhaps you could post the bit of code that's giving you
trouble (not sure if that will help in this case). Or you might try
C<wait>ing for someone more knowledgeable than I.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Mon, 07 Sep 1998 20:02:07 GMT
From: KlausRusch@atmedia.net
Subject: Re: help with mail sending.
Message-Id: <6t1e3v$pnf$1@nnrp1.dejanews.com>
In article <35f14f6e.18988370@news.ssau.ru>,
ewgeniyk@rs34.ssau.ru (Ewgeniy Kartavtchenko) wrote:
> I want to send email from perl-script without any questions and
> notifications. All of scripts, that i've seen, used
> "/usr/lib/sendmail" file. But it isn't work... Certainly, the way to
> solve it is exist, but I don't know it.
Which platform are you on? Does your system have /usr/lib/sendmail?
> Can anybody help me ? Of course, I'll be very thankful if somebody
> dlows some pl-code in me...
Alternatively, you can use one of the modules available on CPAN, e.g. (without
error checking):
Use Net::SMTP;
$smtp = NET::SMTP -> new('smtp.domain.com', Hello => 'your.domain.com');
$smtp -> mail('sender@domain.com');
$smtp -> recipient('receipient@otherdomain.com');
$smtp -> data(@yourmail);
$smtp -> quit();
$smtp -> reset();
Klaus Johannes Rusch
--
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 07 Sep 1998 15:05:52 -0400
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: My cool DIRTTY PICS page
Message-Id: <35F42E90.E1601B69@fccjmail.fccj.cc.fl.us>
Nathan V. Patwardhan wrote:
>
> 278345@msn.com wrote:
> : Check out my new home page with free xxx pics.
>
> DIRTTY? Maybe this is some kind of new I/O or maybe it's something
> that has to do with your browser, but either way it doesn't have
> anything to do with Perl! Hope this helps!
>
> --
> Nate Patwardhan|root@localhost
No, DIR-TTY is a new file directory structure that wastes lots of space
while causing mindless browsing that, in turn, causes a total loss
in personal productivity.
HTH,
-Sneex-
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
http://www.fccj.org/cgi/mail?webmaster | http://webmaster.fccj.org/Webmaster
------------------------------
Date: Mon, 07 Sep 1998 18:43:53 GMT
From: "Richard" <Richard@WowMe.com>
Subject: Perl Programmer Needed
Message-Id: <JPVI1.2684$JW5.7836177@news.rdc1.md.home.com>
We are looking for a Perl programmer who is familiar with ActiveState's
WinDos Perl on NT server. It would be project based work from home. We are
a small company and probably could not afford an expert. But none of our
needs should require one. If you are interested in making some extra money
in your spare time, please reply to author.
Thank you,
Richard
------------------------------
Date: Mon, 07 Sep 1998 15:15:37 -0400
From: Michael Hodge <mhodge@netcom.ca>
Subject: Perl Source Needed
Message-Id: <35F430D9.29913E3B@lod.com>
Gentlemen,
I'm in search of good, Perl example. Being new to this programming
language, I've progressed to a point where I have intermediate yet
sketchy knowledge of general Perl syntax, etc.
Can anyone point out a reliable source for "good" Perl source? What I
would prefer to do is learn by example.
I imagine any sample of source can't be perfect in all coding aspects,
but I wouldn't mind having style-conformant and concise code to learn
from. What the code does is unimportant, it should only be clean.
Thank you all.
THE ICEPHREAK
icephreak@lod.com
------------------------------
Date: Mon, 07 Sep 1998 20:43:34 +0100
From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: Perl Source Needed
Message-Id: <35F43766.73B27FD0@qmw.ac.uk>
Michael Hodge wrote:
>
> Gentlemen,
>
> I'm in search of good, Perl example. Being new to this programming
> language, I've progressed to a point where I have intermediate yet
> sketchy knowledge of general Perl syntax, etc.
>
> Can anyone point out a reliable source for "good" Perl source? What I
> would prefer to do is learn by example.
> I imagine any sample of source can't be perfect in all coding aspects,
> but I wouldn't mind having style-conformant and concise code to learn
> from. What the code does is unimportant, it should only be clean.
>
> Thank you all.
>
> THE ICEPHREAK
> icephreak@lod.com
You could do worse than look at the source for the standard Perl
modules -- most of them are quite nice.
Julian
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Julian Gilbey Email: J.D.Gilbey@qmw.ac.uk
Dept of Mathematical Sciences,
Queen Mary & Westfield College,
Mile End Road, London E1 4NS, ENGLAND
------------------------------
Date: Mon, 07 Sep 1998 23:24:43 GMT
From: swneal@mindspring.com (NAME)
Subject: Please help with perl checkbox
Message-Id: <35f46b27.154482698@news.mindspring.com>
I am trying to install on my home page a check box for my users to
check for yes ( the box when checked has a value of YES. The command
in which the CGI program uses to report this to me in email is:
print MAIL " They Found Us At: Yahoo $in{'yahoo'}\n" if ($in{'yahoo
yes'} =~ /\S/);
Which returns : Yahoo yes if the box is checked.
I would appreciate it if someone could give me the command for this to
print only the check box that return a no for the boxes that are
unchecked.
I am also interested in talking to someone about writing a perl 5
program for us starting approximately November 1998. We have the HTML
forms almost complete and need a perl program to read and write
answers to us in email and also store information into a database.
Please email us at webmaster@abusiness.com
------------------------------
Date: Mon, 07 Sep 1998 21:14:55 +0200
From: Oscar Fernandez Sierra <oscar@charpy.etsiig.uniovi.es>
Subject: Re: Problem: Opening Word (ack!) doc w/ OLE
Message-Id: <35F430AF.6E8F@charpy.etsiig.uniovi.es>
scott@softbase.com wrote:
>
> Charles Sherman (euschsh@am1.ericsson.se) wrote:
> > $wd->Documents->Open('FileName:="C:\DOCS\MYDOC.DOC"');
>
Here is a example. Something works, something no. I don't know
how to save a file. The comments are in spanish, sorry.
#
# Ejemplo de uso de Word desde Perl. Basado en la documentacion
# D:\perl\html\lib\site\Win32\OLE.html, con modificaciones, pues
# el ejemplo original era para Excel.
#
# Oscar, Agosto-98
#
# Nota: - Este ejemplo si me funcions (al menos en parte)
# - No me funciona lo de guardar un documento con SaveAs, aunque
# si cierro la ventana, me aparece el dialogo de salvar.
# - Ver abajo como asignar valores a las properties
# - Quiza la causa de que el SaveAs no funcione bien sea que haya
# que especificar todos los parametros. En VBA, cuando hay
varios
# parametros en una funcion se pueden indicar con el nombre y su
# valor, pero aqui es posible que haya que dar todos los
parametros
#
#
use Win32::OLE;
print "Creando una conexion OLE con Word ...\n";
$ex = new Win32::OLE 'Word.Application' or die "oops\n";
print "Activando la visibilidad de la aplicacion ...\n";
$ex->{Visible} = 1; # si lo comento o quito, no muestra la ventana
print "Cambiando de directorio ...\n";
#$ex->Application->ChangeFileOpenDirectory("C:\\oscar\\docs\\reg2\\espacio-estados");
$ex->Options->{DefaultFilePath}="C:\\oscar\\docs\\reg2\\espacio-estados";
$leido=$ex->Options->StartUpPath;
print "Abriendo un documento del disco ...\n";
print "\$ex->Options->StartUpPath=$leido\n";
print "Abriendo un documento del disco ...\n";
$leido=$ex->Documents->Open('c:\\kk.doc');
print "$leido\n";
# Aqadir nuevo documento (funciona)
#print "Anyadiendo un documento nuevo ...\n";
$nuevo=$ex->Documents->Add; # Devuelve una referencia al documento
creado
# que podemos usar, por ejemplo, para
cerrarlo
#print "Nuevo documento = $nuevo";
#print "Pulsar RETURN para seguir"; <STDIN>;
#print "Cerrando la ventana recien creada\n";
#$nuevo->Close;
# Insertar texto (funciona)
print "Insertando texto en el documento ...\n";
$leido=$ex->ActiveDocument->Range->InsertAfter("Me ha castigado el profe
a que copie varias veces la siguiente frase:\n");
sleep(1);
for ($i=0; $i <5; $i++)
{
$leido=$ex->ActiveDocument->Range->InsertAfter("Manoliqo esta
chiflado\n");
sleep(1);
}
$leido=$ex->ActiveDocument->Range->InsertAfter("\n\nMe despido para
siempre. Adios.\n");
sleep(1);
print "$leido\n";
#print "Parent ...\n";
#$leido=$ex->Documents->Parent;
#print "$leido\n";
print "Documents->Count ...\n";
$leido=$ex->Documents->Count;
print "\$ex->Documents->Count = $leido\n";
$leido=$ex->Application->ActiveDocument;
print "\$ex->Application->ActiveDocument= $leido\n";
$leido=$ex->Application->ActivePrinter;
print "\$ex->Application->ActivePrinter= $leido\n";
$leido=$ex->Application->ActiveWindow;
print "\$ex->Application->ActiveWindow = $leido\n";
#
# Ver que para asignar los valores a las properties, hay
# que poner el nombre entre llaves
#
print "Cambiando titulo a la ventana ...\n";
$ex->Application->ActiveWindow->{Caption} = "pepito";
$leido=$ex->Application->BrowseExtraFileTypes;
print "\$ex->Application->BrowseExtraFileTypes = $leido\n";
$leido=$ex->Application->Caption;
print "\$ex->Application->Caption = $leido\n";
$leido=$ex->Application->{DefaultSaveFormat};
print "\$ex->Application->{DefaultSaveFormat} = $leido\n";
# NewWindow duplica la ventana activa
# $leido=$ex->Application->NewWindow;
# print "\$ex->Application->NewWindow = $leido\n";
# Con Close, lo cierra, y si no esta guardado pregunta el nombre
#print "Cerrando un documento ...\n";
#$leido=$ex->Documents->Close;
$FileName="c:/kk2.doc";
$FileFormat=6; # 6 = RTF
$LockComments=Variant(VT_BOOL,0);
$Password="";
$AddToRecentFiles=Variant(VT_BOOL,0);
$WritePassword="";
$ReadOnlyRecommended=Variant(VT_BOOL,0);
$EmbedTrueTypeFonts=Variant(VT_BOOL,0);
$SaveNativePictureFormat=Variant(VT_BOOL,0);
$SaveFormsData=Variant(VT_BOOL,0);
$SaveAsAOCELetter=Variant(VT_BOOL,0);
print "Esperando un segundo ...\n";
sleep(2);
print "Intentando guardar un documento al disco ...\n";
#$leido=$ex->Application->ActiveDocument->SaveAs($FileName,
# $FileFormat, $LockComments, $Password, $AddToRecentFiles,
# $WritePassword, $ReadOnlyRecommended, $EmbedTrueTypeFonts,
# $SaveNativePictureFormat, $SaveFormsData, $SaveAsAOCELetter);
print "$leido\n";
#print "Saliendo de Word ...\n";
#$ex->Quit;
------------------------------
Date: Mon, 07 Sep 1998 15:17:45 -0400
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: setuid CGI
Message-Id: <35F43159.7F532665@fccjmail.fccj.cc.fl.us>
Sam Wang wrote:
>
> let me get this straight, i can run the cgi script under me (the owner),
> if i set setuid to my ui, right? ok. great. but how do i find out my id?
>
> and i can set id, with setuid "UID", right?
Ask; or execute 'id' under unix, or if on Windoze, ask.
HTH,
-Sneex-
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
http://www.fccj.org/cgi/mail?webmaster | http://webmaster.fccj.org/Webmaster
------------------------------
Date: Mon, 07 Sep 1998 13:33:03 +0000
From: Funkybiz@aol.com (Sunni Leigh)
Subject: SSI Problem
Message-Id: <Funkybiz-ya02408000R0709981333030001@news.wco.com>
I am having some problems with an SSI tag, I put it in my page and all I
get is this:
[an error occurred while processing this directive]
I can not figure out what I am doing wrong...I have tried so many different
things, I am going to go crazy.
This is the tag that I am putting in, but i just can't figure out what
should be in there
<!--#exec cgi="cgi-bin/poll.cgi" -->
I am running this on wco/verio
Anyone that can help I would really appreciate it.
It seems to work when I call the poll.cgi by itself but it won't work when
I embed in my page.
Thank you
Sunni
------------------------------
Date: 07 Sep 1998 22:32:08 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: user environment variable
Message-Id: <7x1zpnmzp3.fsf@vcpc.univie.ac.at>
Re: user environment variable, mbower
<mbower@my-dejanews.com> said:
mbower> Does anyone know how to get the current username
mbower> inside a perl script ? I'm using Apache's httpd and
$<
mbower> have turned on .htpasswd , so it's the username from
mbower> here that I want to access.
Ahh, WWW instead. In a protected realm, the accesser
information (if available) is given by:
use CGI;
my $user = remote_user();
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Mon, 07 Sep 1998 16:30:38 -0400
From: THE ICEPHREAK <icephreak@lod.com>
Subject: Re: What is the purpose of Perl
Message-Id: <35F4426E.107FCC11@lod.com>
Eric Umehara wrote:
> I'm learning perl and am curios whatis the purpose of Perl?? What can
> it do and hwat has it done.
Eric,
Perl can do plenty and can't do little. Depending on your platform, if
UNIX, Perl
serves as a powerful scripting tool for automating simple (and complex)
system
administration tasks. Its main use is extraction; the E in Perl represents
extraction.
If you're updating system databases or creating reports, Perl's advanced
pattern
matching capability lets you scan your filesystem for the information you
need,
and nothing more.
Perl's syntax is remarkably like C's. Perl syntax rules are more forgiving
that C's
too. It's easy to learn and it's intuitive. Most would consider it a good
entry-level
language for learning. I only started learning Perl three weeks ago
myself.
Perl is pretty versatile. You can write a program that could list the
contents of
a UNIX directory in three lines of code. You can also write server
software in
a few hundred, depending. You've seen Perl in action already; CGI
guestbooks
on websites are created using Perl.
Hope that helps,
Happy Hacking,
THE ICEPHREAK
icephreak@lod.com
------------------------------
Date: Mon, 07 Sep 1998 20:44:11 GMT
From: "Jabok" <Jabok@usa.net>
Subject: Why the syntax Error? Code included...
Message-Id: <vAXI1.25$95.180826@news.goodnet.com>
This script call s the library function derivehead but always gets a syntax
error in the library
at the print command "syntax error" line X by print
Cann anyone tell me why this one breaks whereas the lower code works?
--------------------- Caller =
test.cgi -----------------------------------------------------------------
#!/usr/local/bin/perl -w
# Name: Html Parsing Routine
#
# Version: 1.0
#
# Last Modified: 09-01-98
# $template_base = "http://www.server.com/~user";
# $template_path = "/home/u/user/public_html";
# $template_file = "page.htm";
$| = 1;
print "Content-type: text/html\n\n";
require "./temptest.pl";
derivehead ("page.htm", "/home/u/user/public_html",
"http://www.server.com/~user");
print "IT WORKS";
exit;
------------------------------ Library =
temptest.pl ------------------------------------------------------
Sub derivehead
{
local($template_file, $template_path, $template_base) = @_;
print "$template_path/$template_file"; #syntax error
# open (FILE,"<$template_path/$template_file");
# @LINES=<FILE>;
# close (FILE);
# $SIZE=@LINES;
#the script continues
}
1;
==================== this call Works ! =============================
#!/usr/local/bin/perl -w -T
# $template_base = "http://www.server.com/~user";
# $template_path = "/home/u/user/public_html";
# $template_file = "page.html";
require "./test3.pl";
loadpath ("page.html", "/home/u/user/public_html");
=================== to this library ! ================================
sub loadpath
{
local($template_file, $template_path, $template_base) = @_;
print "$template_path/$template_file";
exit;
}
1;
----------------------------------------------------------------------------
-----------------------------------
I'm relitivly new to Perl but I can not for the life of me figure out why
the lower works but the upper does not
Many thanks in advance
Jabok
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3654
**************************************