[6641] in Perl-Users-Digest
Perl-Users Digest, Issue: 266 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 10 06:07:33 1997
Date: Thu, 10 Apr 97 03:00:22 -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 Thu, 10 Apr 1997 Volume: 8 Number: 266
Today's topics:
Re: "Dummies" book any good? (Anthony Boyd)
A bug in stat() ? <chrism@spuddy.mew.co.uk>
Re: Accepting bid on script (Geoffrey Hebert)
Re: Help Configuring to run a perl program <jc@buffie.mko.dec.com>
HELP: FormMail Configuration <PleaseReply@This.NG>
How Does Perl Store Numbers Internally <kevina@clark.net>
Re: How to tell if a file exists? <nealnach@cr.usgs.gov>
Re: Interfacing perl with clearcase (Brad Appleton)
Internally formatted variable <langlois@ccg.RNcan.gc.ca>
Re: Need to hack RCS files (Kevin Cline)
Re: Ousterhout and Tcl lost the plot with latest paper (Michael Kagalenko)
Re: Ousterhout and Tcl lost the plot with latest paper <monnier+comp.lang.functional@tequila.cs.yale.edu>
perl and CGI.pm <sneci@ntb.bme.hu>
Re: perl and CGI.pm <vladimir@cs.ualberta.ca>
Perl cross reference url correction (Geoffrey Hebert)
Re: porting fcntl call: argument types?? (Charles DeRykus)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 09 Apr 1997 22:12:20 -0700
From: anthony@outshine.com (Anthony Boyd)
Subject: Re: "Dummies" book any good?
Message-Id: <anthony-0904972212200001@anthony.outshine.com>
duchar96@sparky.cs.nyu.edu (Robert Ducharme) wrote:
> Has anyone had a chance to take a look at the recently released "Perl
> for Dummies" book? Is it any good? I'm looking for something to
> recommend to non-programmer complete beginners.
Hey! A question *I* can answer! I bought "Teach Yourself Perl In 21
Days" and couldn't get past chapter 5. I bought "Teach Yourself CGI
Programming With Perl In 14 Days" but didn't feel like it was giving me a
good foundation. I bought the "Perl In Full Color" book, and it's nifty
to look at but not very compelling otherwise. Although I admire the
author -- some very smart coding in that book.
But "Perl For Dummies" is the first book that I actually read through and
understood well. It is very beginner-oriented (obviously) and has good
real-life examples. I felt like I was getting the concepts well, and the
fact that I was reading and writing to a flat-file database by chapter 6
was great.
It was a bit frustrating to have the author refer to arrays as lists. I
guess that a correct way to refer to arrays (?) but I think beginners
don't need the confusion. Also, "$this" is referred to as a "variable" --
the word "scalar" doesn't even pop up until half way through the book.
More confusion. But aside from those caveats, it was great to finally
overcome the problems I had with previous books and get some scripts
working (with help from this group).
-Anthony Boyd
------------------------------
Date: Wed, 9 Apr 1997 08:54:32 GMT
From: Chris Manning <chrism@spuddy.mew.co.uk>
Subject: A bug in stat() ?
Message-Id: <264a87847@spuddy.mew.co.uk>
The blue camel book says
If stat is passed the special file handle consisting of an underline, no
actual stat(2) is done, but the current contents of the stat structure
from the last stat or stat-based file test (the -x operators) are
returned.
Every other piece of documentation that I can find says something similar,
but while this
#!/usr/local/bin/perl -w
open(INPUT,"< $0") ||
die "Cannot open $0 for input ($!)\n";
$a=-s INPUT;
@b=stat(_);
print "Size: $a\n\n";
print "Stat:\n",join("\n",@b),"\n";
close INPUT;
Size: 185
Stat:
1799
[snip]
2
works as I'd expect, this
#!/usr/local/bin/perl -w
open(INPUT,"< $0") ||
die "Cannot open $0 for input ($!)\n";
@a=stat(INPUT);
@b=stat(_);
print "First:\n",join("\n",@a),"\n\n";
print "Second:\n",join("\n",@b),"\n";
close INPUT;
First:
1799
[snip]
2
Second:
doesn't. It seems that the second stat() has returned an empty array. If
stat() is broken it's been so for a long time, as I've tried it on versions
of perl from 3.0.1.9 to 5.003, with consistent results.
Chris
--
--
chrism@spuddy.mew.co.uk
For free mail and usenet access call Spuddy on (01268) 515441
------------------------------
Date: Thu, 10 Apr 1997 00:57:59 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: Accepting bid on script
Message-Id: <5ihcv6$822$1@news3.microserve.net>
Nice try, I hope this work for you.
Perhaps a little more detail -
What is your web site?
Is this about right -
What you whant is a little button like
__________________
| click here for drawing |
---------------------------------
When they click there they get
____________________
| Thanks, all we need is a little information
| to send your prise.
| Your name and email address
| name _____________
| email _____________
| CLICK HERE to register for drawing
| (besure to read rules below)
______________________-
______________________
| Thanks again you have been resistered
| for the drawing.
| You will receive an email shortly notifing you
| of your winnings
|----------------------------------------------------
Email script check rules select random number
sends standard winning or lossing script
Can do script but too busy
If you have a site, how does your site support Perl
Ask what release level?
is libwww.pl installed?
You will of cource supply all the leagallees
George Arnett <hmpgconn@electro-net.com> wrote:
>Please send me your bid for the following script:
>I need a cgi script that will allow a random user that visits my Web
>site to win stuff. It would require a means for the user to register
>with the system (so one user cannot win over and over again), a simple
>random selection mechanism, a means for you to "insert" a prize and a
>frequency, and a winner confirmation form (with appropriate legaleze
>throughout).
>If you need more details (or just want to submit your bid), please email
>me at mailto:hmpgconn@electro-net.com
------------------------------
Date: Wed, 09 Apr 1997 16:00:37 -0400
From: John Chambers <jc@buffie.mko.dec.com>
To: jdcs100@york.ac.uk
Subject: Re: Help Configuring to run a perl program
Message-Id: <334BF565.2781@buffie.mko.dec.com>
James D.C Savage (MS0) wrote:
>
> This is the first time I have tried to use perl. I have obtained a set
> of perl programs writen by someone else and have changed my Unix Profile
> so that my path includes the directories where I think perl should be:
>
> path=($path /bin/perl /usr/bin/perl /usr/sbin/perl /usr/lib/perl
> /usr/share/catman/u_m)
...
> The perl program starts with the following line
> #!/usr/local/bin/perl -w
> I assume that this tells unix shell what interpreter to use.
>
> When I try and execute the perl program by typing "main_prg" it fails
> and gives a message as follows:
>
> main_prg: No such file or directory
It's almost certainly telling you that /usr/local/bin/perl isn't where
your
perl was installed. I notice that /usr/local/bin isn't one of the
things
you put in your $path variable. Do you know where it actually is?
which perl
might tell you. If not, try
find / -name perl -print
and go for a cup of coffee. Then you have two choices: You can modify
all the perl scripts to contain the True Path to your perl. Or you can
use ln (or ln -s) to make /usr/local/bin/perl point to where perl was
actually installed.
The perl books generally recommend /usr/bin/perl; if that's where it is
on
your machine, you might want to modify your scripts to follow this
"standard".
If it's anywhere else, you probably want to set up the link. What I
usually
do is make sure all of /bin/perl, /usr/bin/perl and /usr/local/bin/perl
exist, since it's common to see scripts with any of these in the #!
line.
The #! mechanism (which is probably in your kernel, not in any shell)
won't
use your $path at all; it sees the full path "/usr/local/bin/perl" and
tries
to exec that program. If it doesn't exist, it gives you the message
that
you got. Unfortunately, the message doesn't tell you the actual name of
the file that wasn't found. (That's a "future enhancement" that we've
been
waiting for for 20 years or so. ;-) But when you get it from a script,
it
almost always means that the #! line has the wrong path.
------------------------------
Date: Wed, 09 Apr 1997 16:12:25 -0400
From: Peter Myers <PleaseReply@This.NG>
Subject: HELP: FormMail Configuration
Message-Id: <334BF829.61F4@This.NG>
I am using FormMail V-1.5 written in Perl, on a UNIX host
server which implements the sendmail program. I am having
the following problems:
1) I placed a textarea box on my HTML form as follows:
<TEXTAREA NAME="Notes" COLS="55" ROWS="6" WRAP="PHYSICAL"></TEXTAREA>
The text written in this text box, only wraps on the HTML form.
How do I get it to show up wrapped in my E-Mail message?
2) This is the line from the FormMail script, which puts the
E-Mail and Name into the "From:" field in the header of the
E-Mail message:
print MAIL "From: $CONFIG{'email'} ($CONFIG{'realname'})\n";
These are the lines in the HTML form, which are to be set:
<input type=text name="realname">
<input type=text name="email">
I don't want to use the email field, just the realname field.
I want to have the "From:" field show either of the following:
A) A certain value which I choose, ie: "From: My Web Site Form"
B) I'd like to use one or combine both of the "Name" fields from
the HTML form, and have them show in the "From:" header.
These are the input fields I'm using:
<INPUT TYPE="text" NAME="First Name">
<INPUT TYPE="text" NAME="Last Name">
When I try to change the script, the resulting E-Mail message
displays the E-Mail address of my Host Server, followed by the
realname field. It also places periods in any spaces between
names. If I leave the E-Mail field blank or delete it from the
script, It displays nothing at all.
3) FormMail has an HTML page which displays the required fields
that were left blank after filling out the form. At the bottom
of this page is a link (which I specify) to return you back to
the form to fill it out again. The problem is that when clicked,
this link returns you back to the bottom of the form (or
whatever position your form page was in when you submitted it)
and also clears (resets) the form. Instead of just entering the
fields you left blank, you now must fill out the entire form
again.
Thank you for your time, I'd appreciate any help!
Please respond to this newsgroup.
Thanks, Peter M.
------------------------------
Date: Wed, 09 Apr 1997 20:33:23 -0600
From: Kevin Atkinson <kevina@clark.net>
Subject: How Does Perl Store Numbers Internally
Message-Id: <860635736.13823@dejanews.com>
I am curious how perl stores numbers internally.
Is it as a string, or a float, it deponds, or something totally diffrent.
For Example:
$x = 5 (how is this stored)
$x += 0 (now what is $x internally)
"$x" (This is stored as a string right)
$x += 0 (is it now a float internaly?)
Thanks in advance.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 9 Apr 1997 23:52:38 GMT
From: Neal Nachtigall <nealnach@cr.usgs.gov>
Subject: Re: How to tell if a file exists?
Message-Id: <Pine.D-G.3.91.970409185220.1294D-100000@dlgek.cr.usgs.gov>
if(-e $file)
--
Neal L. Nachtigall * nealnach@edcmail.cr.usgs.gov
Hughes STX * EROS Data Center
Swing hard, in case they throw the ball where you're swinging. -Duke
Snider
On 3 Apr 1997, I hate spam! wrote:
> Is there a way (other than open) to tell whether or not a file exists?
> --
> ----
> To reply to this message, please remove the last 4 characters from the
> email address...
>
>
>
------------------------------
Date: Tue, 8 Apr 1997 19:01:36 GMT
From: appleton@chiefs.northbrook.aieg.mot.com (Brad Appleton)
Subject: Re: Interfacing perl with clearcase
Message-Id: <1997Apr8.190136.27935@schbbs.mot.com>
In article <vkzlo6zcedu.fsf@marlis.grenoble.hp.com>,
Dominique Dumont <domi@marlis.grenoble.hp.com> writes:
>
>If I remember well, Atria now provides a perl library.
>
They have some stuff for interfacing ClearCase and ClearGuide with
Perl 5. Of course some of us would like to see more. A few years back
I wrote a Perl 4 library for ClearCase to do all sorts of things that
Perl scripts might need to do. I called it "ClearPerl" and made it
freely available but then my employer made me yank it. Im currently
working on a complete re-write in Perl 5, but Im doing it on my own
time with my own computing resources so that I am the sole owner and
copyright holder and can make it freely available.
If you are interested in discussing ClearPerl5 or contributing to it,
please send me *private* email at the address given below.
--
Brad Appleton <bradapp@enteract.com> | http://www.enteract.com/~bradapp/
"And miles to go before I sleep." | 2500+ WWW links on CS & Sw-Eng
------------------------------
Date: Wed, 09 Apr 1997 15:36:04 -0400
From: Dominic Langlois <langlois@ccg.RNcan.gc.ca>
Subject: Internally formatted variable
Message-Id: <334BEFA4.2356@ccg.RNcan.gc.ca>
Hi to everyone,
First, excuse-me about my poor english. I am not sure if my question is
trivial
but I can't find an answer to it. I am just a perl newbie who wants to
learn and
understands.
So, I would like to internally format a variable in such a way that it
shows
0022 instead of just 22. I am looking a way to do this as in C with :
sprintf (referId, "%04d", id); .
I need this because I will use referId in many places in the program and
I don't
want to format every time.
I have searched in the Llama and Camel books some references or examples
but
found nothing but the printf and format commands which seemed unuseful
in this
case.
Thanks for any help.
--
Dominic Langlois til: (819) 564-5600 ext. 4828
Centre d'information topographique fax: (819) 564-5698
Centre for Topographic Information E-Mail:
Dominic.Langlois@CCG.RNcan.gc.ca
------------------------------
Date: Thu, 10 Apr 1997 05:19:56 GMT
From: clines@airmail.net (Kevin Cline)
Subject: Re: Need to hack RCS files
Message-Id: <334c7796.7201491@news.airmail.net>
paddy.spencer@parallax.co.uk (Paddy Spencer) wrote:
>clines@airmail.net (Kevin Cline) kirjoittanut::
>
>: Does anyone have any code to parse RCS files?
>
>Erm, I've got the RCS binaries[1]; they generally do a pretty good
>job.
>
>If they're not enough I've got a text editor.
>
>What _specifically_ do you want?
I want to be able to fill in missing RCS functionality, like changing the log
message for a revision. I want a perl module that will parse an RCS file
creating some perl objects, allow modification of those objects, then
overwrite the RCS file. Maybe it would be easier to just hack the RCS source
code, but I'm not sure.
------------------------------
Date: 10 Apr 1997 00:21:25 -0400
From: mkagalen@lynx.dac.neu.edu (Michael Kagalenko)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5ihps5$44k@lynx.dac.neu.edu>
Richard A. O'Keefe (ok@goanna.cs.rmit.edu.au) wrote in article <5iacot$sd7$1@goanna.cs.rmit.edu.au> <pre><blink>
]ouster@tcl.eng.sun.com (John Ousterhout) writes:
]
]> - It is possible to make languages with execution speeds like C or C++,
]> that use dynamic typing successfully, whilst being high-level enough
]> in the creation of abstractions to "glue" things together quite
]> nicely and easily.
]
]>Can you point to a specific language and identify a large community of
]>users who agree with this assessment?
]
]But restricting it to a large community smuggles in another criterion:
]marketing. SELF, for example, has dynamic typing, and published benchmarks
]show it close to C or C++. I imagine people at Sun would understand more
]about SELF than I do. I've certainly had Scheme code perform close to C
](with the aid of comilers that do a fair amount of type inference, admitted.)
]
]I would also expect someone from Sun to be aware of the awesome ease of
]interoperability with C/C++ offered by ESH.
]
]>Either you have a strongly typed language, which gives high
]>speed and manageability but makes gluing hard, or you have a weakly
]>typed language with the opposite properties.
]
]This is clearly false. You can have a language with *optional*
]declarations which can be checked and relied on if they are there.
ObjC is one such language. In objective C you have to declare
class interfaces, and you _can_ enable type-checking by
statically typing your variables. ( I think function prototypes
are optional, though, I think)
------------------------------
Date: 09 Apr 1997 20:00:57 -0400
From: Stefan Monnier <monnier+comp.lang.functional@tequila.cs.yale.edu>
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5lragjoifa.fsf@tequila.systemsz.cs.yale.edu>
ouster@tcl.eng.sun.com (John Ousterhout) writes:
> But I stand by the two main points in the paper, which are that (a) OO
> programming hasn't increased productivity dramatically because it doesn't
Now, I don't understand one thing: why is OO evil if its only problem is that
it doesn't increase productivity ? As far as I can see, OO doesn't have too
many nasty side-effects.
Once you have admittedl that what you meant by "strongly typed" was actually
"statically typed" and that Tcl is more or less "dynamically typed", the
question comes down as: what is the advantage of Tcl over other dynamically
typed languages ? I can see reasons to use a dynamically typed language (for
scripting among other things), but why insist on a string-based system ?
String based systems have several problems that you have to recognize such
as performance (Tcl is well known for its lame speed and to overcome it,
Tcl-8.0 has to partly drop the "everything's a string" principle) and support
for data-structures. Now you'll say "if you need data-structures, go to C", but
why ? Why couldn't my scripting language support data-structures nicely ?
I didn't need hand-assembly performance for my "approximate email matching"
in Exmh's interface to PGP, and since Exmh is a tcl-only program, including C
code in the distribution would have been a huge pain, so I coded the thing in
Tcl, result:
- the code is ugly
- the performance is bearable on current fast machines, whereas with the
simplest scheme interpreter (which only offers lists but no proper
structures), it would have been instantaneous even on a lowly 286 (or 68K)
Stefan
-----------------------------------------------
-- strings are the MS-DOS of data-structures --
-----------------------------------------------
------------------------------
Date: Wed, 09 Apr 1997 16:19:13 +0200
From: Schneemaier Akos <sneci@ntb.bme.hu>
Subject: perl and CGI.pm
Message-Id: <334BA561.4901@ntb.bme.hu>
Hi Everybody !
I'm new with cgi scripts and perl. I want to setup my linux box to run
some CGI scripts. Well that part is OK. I can run small scripts (the
one's come with apache ).
But if I try to use CGI.pm ( use CGI.pm etc. ) i get an error message
from the server:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, root@hivolt.ntb.bme.hu and
inform them of the time the error occurred, and anything
you might have done that may have caused the error.
When i start the script from the server prompt: it's says the following
error message:
Undefined subrutine &main::start_html called at ./file.pl line 6.
file.pl the same script showed in the CGI.pm docs.
I have looked for help in the docs come with the CGI.pm 2.32
distribution. It says somthing about the option Self Loader but the link
is point to nowhere. IF somebody could help, pleas post me an answer or
a link where i can find an answer.
Thanks
Akos Schmaier
Ph.D. Student
------------------------------
Date: 09 Apr 1997 23:58:12 -0600
From: Vladimir Alexiev <vladimir@cs.ualberta.ca>
To: Schneemaier Akos <sneci@ntb.bme.hu>
Subject: Re: perl and CGI.pm
Message-Id: <omohbn2zd8.fsf@tees.cs.ualberta.ca>
In article <334BA561.4901@ntb.bme.hu> Schneemaier Akos <sneci@ntb.bme.hu> writes:
> Undefined subrutine &main::start_html called at ./file.pl line 6.
Looks like bare start_html is called instead of $query->start_html, or
use CGI ':standard'; and only then bare start_html.
> file.pl the same script showed in the CGI.pm docs.
I don't see such a file in examples/, nor a mention of it in cgi_docs.html
------------------------------
Date: Thu, 10 Apr 1997 01:56:25 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Perl cross reference url correction
Message-Id: <5ihgcn$996$1@news3.microserve.net>
That right a perl cross reference.
But I gave an incorrect URL
use http://www.microserve.net/~soccer/
>
> Add line numbers
> Add Bracket level numbers
>
> Generate HTML
>
> When looking at cross reference click on number and get to code
> immediately.
>
> Check it out - if you get a security screen use password perlmisc
>
> http://www.microserve.net/~soccer/xref/
------------------------------
Date: Wed, 9 Apr 1997 22:59:18 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: porting fcntl call: argument types??
Message-Id: <E8E7uu.3Hz@bcstec.ca.boeing.com>
In article <33492B55.5311@odin.sunquest.com>,
yicky <yicky@yack.yucky, yyum> wrote:
> Having got a
> use Fcntl;
> fcntl( FH, O_NONBLOCK, $packedreturnbuffer)|| die "horribly";
> to work on one unix box, I tried porting it to another. But the second
> required something along the lines of
> fcntl( FH, F_SETFL, ???);
> where the ??? was an unknown argument type. I've tried packing the
> O_NONBLOCK several different ways, passing the value through variables,
> etc. I've also tried setting other flags than O_NONBLOCK.
> I've looked through the perl docs, fcntl manpages, fcntl .h, blah, blah,
> blah, but the answer is escaping me.
>
> According to all this documentation, the fcntl is supposed to be
> fcntl( (int) file, (int) operation, (int) param)
> under c, which *should* translate to
> fcntl( filehandle, int, int)
> under perl, but apparantly doesn't. <arrggh!>
>
> Anyone have some ideas about what the third (and possibly second)
> argument should be?
>
Did you specifically try something like this, e.g.:
fcntl( FH, F_SETFL, O_NONBLOCK) or die "fcntl error: -1\n";
--
Charles DeRykus
ced@carios2.ca.boeing.com
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
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 266
*************************************