[7828] in Perl-Users-Digest
Perl-Users Digest, Issue: 1453 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 11 08:07:44 1997
Date: Thu, 11 Dec 97 05:00:47 -0800
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, 11 Dec 1997 Volume: 8 Number: 1453
Today's topics:
Re: ? Determining the directory of an executing script (Gerben Wierda)
Re: ? Determining the directory of an executing script (Gerben Wierda)
Re: Cache'ing getpwnam()? (Casper H.S. Dik - Network Security Engineer)
df on an NFS volume? <jjn@sanger.ac.uk>
Help with project (Birjinder Singh Anant)
how to pre-allocate memory chunk <upendra1@hotmail.com>
IIS 4.0 and Perl CGI scripts. (John Green)
is there anyway around this ssi problem with "query_Str (283492834)
Is this code safe? (destructive dbm unlocking) <sbekman@iil.intel.com>
Re: Need documentation on WORD_BASIC ole module (grega)
Re: Perl Plug-In for Netscape? (robert)
Re: Please advise. Fastest way to line-count files (Malcolm Beattie)
Re: Problem with Blat in perl script (John Green)
re:Perl for windows 95 <acid@fuse.net>
real uid cgiwrap error jocham@cris.com
Re: recursive regex? (Tushar Samant)
Re: removing duplicate entries from the PATH variable <alester@bfsec.bt.co.uk>
Re: Review of CGI/Perl book (Tushar Samant)
Re: Review of CGI/Perl book (brian d foy)
Re: running perl with cgi on a NT? <bowlin@sirius.com>
Re: Simple/small socket script doesn't work (Frank Varnavas)
Re: There's More Than One Way? (Tushar Samant)
Re: There's More Than One Way? (brian d foy)
Re: using PERL with Personal Web server under 95 <bowlin@sirius.com>
Re: using PERL with Personal Web server under 95 <admin@alphaweb.co.uk>
Re: What is wrong with this script? (brian d foy)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 11 Dec 1997 09:19:13 GMT
From: G.C.Th.Wierda@AWT.nl (Gerben Wierda)
Subject: Re: ? Determining the directory of an executing script ?
Message-Id: <EL0pw2.6G5@AWT.NL>
Temporarily , I have been using this.
use vars qw( $PRGDIR $PRGNAME);
BEGIN {
warn "Compiling...\n";
if (not defined $PRGDIR) {
$PRGNAME = $PRGDIR = $0;
$PRGDIR =~ m'([^/]*/)+';
$PRGNAME = $PRGDIR = $1; #untaint
$PRGDIR = "./" . $PRGDIR unless ($PRGDIR =~ m'/');
$PRGDIR =~ s@^(.*)/[^/]+$@$1@;
$PRGNAME =~ s@.*/@@;
undef %ENV;
$ENV{PATH} = "/usr/bin:/bin";
$ENV{SHELL} = '/bin/sh';
use Cwd;
chdir $PRGDIR;
$PRGDIR = cwd;
# Untaint: note that this is insecure if someone secretly
# overrides Cwd
$PRGDIR =~ /(.+)/;
$PRGDIR = $1;
}
}
At the end, I also have moved myself to that directory and the $PRGDIR
variable holds the real directory, not one with symbolic links.
---
Gerben Wierda,
Stafmedewerker Adviesraad voor het Wetenschaps- en Technologiebeleid.
Staff member Advisory Council for Science and Technology Policy
Javastraat 42, 2585 AP, Den Haag/The Hague, The Netherlands
Tel (+31) 70 3639922 Fax (+31) 70 3608992
http://www.AWT.nl/prive/wierda/
The fox knows many things, but the hedgehog knows one big thing.
"Is this true or only clever?"
- Augustine Birrell
------------------------------
Date: Thu, 11 Dec 1997 11:00:51 GMT
From: G.C.Th.Wierda@AWT.nl (Gerben Wierda)
Subject: Re: ? Determining the directory of an executing script ?
Message-Id: <EL0uLF.6vK@AWT.NL>
How about this (untested, but should work too in a taintperl environment):
use vars qw( $PRGDIR $PRGNAME);
BEGIN {
if (not defined $PRGDIR) {
$PRGNAME = $PRGDIR = $0;
$PRGDIR =~ m'([^/]*/)*([^/]+)';
$PRGDIR = (defined $1) ? $1 : './'; #untaint
$PRGNAME = $2; #untaint
undef %ENV;
$ENV{PATH} = "/usr/bin:/bin";
$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL};
use Cwd;
chdir $PRGDIR;
$PRGDIR = cwd;
# Untaint: note that this is insecure if someone secretly
# overrides Perl's Cwd module
$PRGDIR =~ /(.+)/;
$PRGDIR = $1;
}
}
The last part is to make sure you get the real full directory, not something
relative. So, if called like this:
../../../somedir/prog.pl
it will get the real dir, instead of the less useful relative dir.
And of course, if someone is able to change your $0 between you starting the
program and the BEGIN stuff being compiled, this is insecure too but tha
chance is pretty small).
---
Gerben Wierda,
Stafmedewerker Adviesraad voor het Wetenschaps- en Technologiebeleid.
Staff member Advisory Council for Science and Technology Policy
Javastraat 42, 2585 AP, Den Haag/The Hague, The Netherlands
Tel (+31) 70 3639922 Fax (+31) 70 3608992
http://www.AWT.nl/prive/wierda/
The fox knows many things, but the hedgehog knows one big thing.
"There is a First Amendment right to speak in a encrypted way...The right
to speak P.G.P. is like the right to speak Navajo. The Government has no
particular right to prevent you from speaking in a technical manner even if
it is inconvenient for them to understand."
- Eben Moglen, Columbia U. professor of law and legal history, in a
_New_York_Times_ article by John Markoff, Sep. 21, 1993
------------------------------
Date: 11 Dec 1997 09:52:37 GMT
From: Casper.Dik@Holland.Sun.Com (Casper H.S. Dik - Network Security Engineer)
Subject: Re: Cache'ing getpwnam()?
Message-Id: <casper.881834395@uk-usenet.uk.sun.com>
[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]
Aaron Minner <minner@chirondiag.com> writes:
>Is it a Perl thing or a Unix/OS thing to cache the results
>of a getpwnam()/getpwuid()? My script runs as a daemon to
>update the password file, but if a user runs the client again
>shortly after the first try, the daemon still has the original
>data for the passwords, not the newly changed password. If I
>wait about 10 minutes or so, the password changes are visible.
>Seems like an NIS cache'ing thing, but I need to be sure. Any
>idea how to get the changes immediately to the daemon?
Solaris 2.5 and later have cache daemon that cache name lookup results,
this may be what is affectign you.
NIS also has some delays in propagting changes.
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
------------------------------
Date: Thu, 11 Dec 1997 12:44:34 +0000
From: Jonathan Nicholson <jjn@sanger.ac.uk>
Subject: df on an NFS volume?
Message-Id: <Pine.OSF.3.96.971211124307.1087N-100000@byron>
I need to be able to do a DF on a disk in the middle of a perl script,
I've found a module that works well on local disks, but I cannot guarantee
that the volume will be local.
Is there any module out there that will work with both local and remote
filesystems?
Regards,
Jonathan
----------------------------------------------------------------------------
= Jonathan Nicholson - System Administrator +44 1223 494987 (internal 4987) =
= The Sanger Centre, Wellcome Trust Genome Campus, Hinxton, Cambs, CB10 1SA =
= Email: jjn@sanger.ac.uk (Work) jono@acme.demon.co.uk (Home) =
----------------------------------------------------------------------------
------------------------------
Date: 11 Dec 1997 10:54:55 GMT
From: bsanant@uclink.berkeley.edu (Birjinder Singh Anant)
Subject: Help with project
Message-Id: <66ogpv$dfp$1@agate.berkeley.edu>
Hi,
I'm very new to perl, and I recently started a job. A few days ago, I was
asked to do a small project, and I need help. Basically, the points I
need help with are:
1. Is there a way to find a certain part of a file, bookended by two
indicators, and delete the entire part, using the indicators?
ex. (a) ....... (b) where a and b are the indicators and ... is
the text in between
2. How do I open a file, make some changes, and save under a new name,
while keeping the original file intact? (I guess this is probably pretty
easy, but I'm still learning, and I need to complete quickly. I have the
O'Reilly book, Learning Perl)
3. Finally, is there a way to insert this new file into a certain part of
another file?
for instance, between (c) and (d) of the third file
Please reply to me personally, unless you want to post here.
Thanks for your help in advance,
Birjinder
------------------------------
Date: 11 Dec 1997 04:09:07 -0800
From: Arvind N V <upendra1@hotmail.com>
Subject: how to pre-allocate memory chunk
Message-Id: <a8zpm8hyjg.fsf@dadsparc31.i-did-not-set--mail-host-address--so-shoot-me>
Hello,
I am using associative arrays where I store more than 100,000 keys. Is
there a way I can preallocate a memory chunk for this associative array?
--
Thanks & Best Regards,
Arvind N V
------------------------------
Date: 11 Dec 1997 11:22:47 GMT
From: jgreen@nimr.mrc.ac.uk (John Green)
Subject: IIS 4.0 and Perl CGI scripts.
Message-Id: <66oie7$qam$2@niobium.hgmp.mrc.ac.uk>
I'm trying to run some Perl CGI scripts under Microsoft's new IIS 4.0
under NT Server. They used to work fine under IIS 2 and 3, but now I get
messages like:
"The server has encountered a configuration error attempting to
process your request. The configuration parameter MD_SCRIPT_MAPS
(6014) has an invalid value..."
The Application extension mapping shows .pl mapped to
c:\perl\bin\perl.exe %s %s
I can't find anything in the IIS documentation that explains what "%s" does,
and changing it to
c:\perl\bin\perl.exe %1 %*
as with previous versions of IIS makes no difference.
Has anybody got any ideas?
Thanks in advance,
John Green, NIMR, London, U.K.
------------------------------
Date: Thu, 11 Dec 1997 13:40:41 GMT
From: 4823@283423 (283492834)
Subject: is there anyway around this ssi problem with "query_String?
Message-Id: <348feca7.13315138@snews.zippo.com>
i have an ssi
<!--#exec cmd="/home/user/go/html/cgi-bin/perl.pl?miscinfo"-->
if i use QUERY_STRING in the perl script, the query after the ? is
ignored. the query string only works if i enter it by hand in the url
box of my browser. is tehre anyway around this? i need the query
string in the ssi, or some other method of putting miscinfo into a log
file.
------------------------------
Date: Thu, 11 Dec 1997 09:22:44 +0200
From: Bekman Stanislav <sbekman@iil.intel.com>
Subject: Is this code safe? (destructive dbm unlocking)
Message-Id: <348F94C4.7AAE@iil.intel.com>
Hi,
I needed to do some worked with tied dbm
And I'm not sure about the code for locking/unlocking the DB which I've
picked from 'Programming Perl' book after I read a week ago a post from
Randal Schwartz, that this is unsafe and distructive
flock(DB_FH,LOCK_UN);
<QUOTE>
Michael> sub unlock {
Michael> flock(MBOX,$LOCK_UN);
Michael> }
Danger, Will Robinson!
Alert, Alert!
Do *not* unlock the file. Ever.[1] Just close it.
Code like the snippet posted above will LOSE DATA and CORRUPT DATA
and MESS UP YOUR DATA. Enough said?
[1] Unless you are smart enough to know exactly what "flushing" and
"don't *ever* use STDIO" means. But you know that I'm lying above
anyway then. :-)
</QUOTE>
Is it the same for files and dbm files, so closing the file is the same
as unlocking and closing
even if I do sync before unlock
And why unlock is might be destructive. Please enlight!
Is it destructive both for files locked with LOCK_SH and LOCK_EX?
Also I would like to know whether one or few of these statement are
redundant: (consider the code at the bottom)
flock(DB_FH,LOCK_UN);
undef $db_obj;
untie %wdb;
close DB_FH;
Since I have added close DB_FH;
because of warning I've got and this line wasn't in the book
Also is there diference if I swap undef $db_obj and untie %wdb and close
DB_FH
Here is a snippet of code:
----------------------------------
use Fcntl;
use MLDBM qw(DB_File);
sub LOCK_SH { 1 }
sub LOCK_EX { 2 }
sub LOCK_NB { 4 }
sub LOCK_UN { 8 }
$db_obj = tie %wdb, 'MLDBM', $full_mldb_name, O_CREAT|O_RDWR,
$mldb_mode or die $!;
$fd=$db_obj->fd;
open(DB_FH, "+<&=$fd") or die "dup $!";
# Get the exclusive write lock
unless (flock (DB_FH, LOCK_EX | LOCK_NB)) {
print "$$: CONTENTION; must have exclusive lock! Waiting for write
lock ($!) ...." if $debug;
unless (flock (DB_FH, LOCK_EX)) { die "flock: $!" }
}
# Modify the DB then
# Release the dbm and lockfile
$db_obj->sync(); # to flush
flock(DB_FH,LOCK_UN);
undef $db_obj;
untie %wdb;
close DB_FH;
-------------------------------
Thank you!
______________________________________________________________________
Stas Bekman mailto:sbekman@iil.intel.com [just another webmaster]
Linux Installation Party [Technion] http://instaparty.israel.eu.org/
Home Page: http://www.eprotect.com/stas
A must visit: http://www.eprotect.com/stas/TULARC (Java,CGI,PC,Linux)
Linux-il Home: http://www.linux.org.il/
------------------------------
Date: 11 Dec 1997 07:59:31 GMT
From: grega9@mail.idt.net (grega)
Subject: Re: Need documentation on WORD_BASIC ole module
Message-Id: <grega9-1112970243520001@ppp-5.ts-4.lax.idt.net>
In article <MPG.ef73ce98514b30c989680@moose.webworks.ca>,
graham@webworks.ca (Graham Wile) wrote:
> I have found a reference that gives a parameter list for
> the perl WORD_BASIC module functions:
>
> http://home.ljusdal.se/perl/ole/Word_Basic.htm
>
> The problem is, I cannot find real documentation, with examples.
> I found some examples for the Excel part, but I need something
> for Word to get me started.
>
> For eaxample, I would like to know how to call Word from a perl
> script, create a new document, and save it as a file. Then
> maybe more advanced stuff. To do that I will need examples on
> how to use the Insert, FileNew, etc. methods in a Perl context
> from a perl script.
>
> Is there anyone there who can point me in the right direction?
> Any help would be greatly appreciated.
>
>
> Thanks
I'm also new to OLE and perl. I once asked the same question to a
Microsoft employee at a trade show. His response is that all ole
automation info about their various ole automation server apps (ie; excel,
etc...) can be found somewhere at microsoft's www site. If you find the
exact location, please let me know.
------------------------------
Date: 11 Dec 1997 12:50:35 +0100
From: robert@il.fontys.nl (robert)
Subject: Re: Perl Plug-In for Netscape?
Message-Id: <66ok2b$jn9@bsd1.hqehv-internal.ilse.net>
clay@panix.com (Clay Irving):
>Alex Tang <altitude@ren.us.itd.umich.edu> writes:
>>I'm not sure if this is what you're talking about, but try
>>http://interact.canoe.ca/~bsugars/nsapi_perl.htm
>I get this:
>
> Not Found
>
> The requested object does not exist on this server. The link you
> followed is either outdated, inaccurate, or the server has been
> instructed not to let you have it.
I get:
Introduction
nsapi_perl is provides a mechanism to embed a Perl interpreter in
a Netscape web server (in the tradition of mod_perl for the Apache
server). This allows one to program to the Netscape Server API
(NSAPI) in Perl rather than in C.
(and more)
robert
------------------------------
Date: 11 Dec 1997 11:27:39 GMT
From: mbeattie@sable.ox.ac.uk (Malcolm Beattie)
Subject: Re: Please advise. Fastest way to line-count files
Message-Id: <66oinb$f91$1@news.ox.ac.uk>
In article <Pine.GSO.3.96.971210124044.15679Q-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
>On Wed, 10 Dec 1997, Ravi Kumar wrote:
>
>> I have 2 sets of files. The first set is a bunch of
>> small (<10K lines) files. The second set is a bunch of large
>> (> 200K lines ) files. I need to line-count these.
>
>> 1. I have found that perl is faster than wc(1)
>
>That's sad, really, when you think about it. Here, somebody has coded a C
>program to do "just one thing, and do it right", and you can still outpace
>it in Perl. At least, on your system. :-)
>
>> 2. In perl I can do it in two ways.
>
>[methods snipped]
>
>> Here are the nebulosities.
>
>> 1. Which approach is faster for small/large files.
>
>The one that finishes first. :-) Use Benchmark, or a similar method to
>time your code.
>
>> 2. For large files, @jj will be massive. How do we deallocate
>> @jj when done (in other words, does @jj=() work instantly???)
>
>Pretty close to that. I wouldn't worry about deallocation times. But worry
>about _allocation_ times: There's no good reason to store data you don't
>need. (Hint.)
>
>> 3. The file sizes are significant (small files: 3M , large files: 60M
>> and all reside on a single server. If I split this job on multiple
>> machines, I create congestion and dont gain any time. So looks like
>> I have to run this on a single fast machine.
>
>Okay. :-)
>
>That said, here's my linecounting code.
>
> open FILE, $filename
> or die "Can't open $filename: $!";
> my $count = 0;
> $count += tr/\n// while read FILE, $_, 1024;
> close FILE;
>
>Arguing about whether this is correct and benchmarking this against other
>methods are left as exercises. :-)
I'd suggest upping the buffer-size from 1024 to at least 4096
(and maybe 8192 or 16384) so that the relative slowness of perl's
internal looping doesn't hit as much for large files. I tried my
Mmap module and started off like this:
use Mmap;
if (@ARGV) {
open(STDIN, $ARGV[0]) or die "$ARGV[0]: $!\n";
}
mmap($data, 0, PROT_READ, MAP_SHARED, \*STDIN) or die "mmap: $!\n";
$count++ while $data =~ /\n//sg;
print "$count\n";
which was fairly fast for small files in comparison to "wc -l" but
was quite a bit slower for larger files (e.g. a 1.5 million line
15 MB file and a 20 MB binary file that had 30000 "lines"). The
above took around 18 secs and the "$count++ while ..." loop was the
bottleneck. Then I remembered that tr/// returned the count of
matches (Tom's posting hadn't reached here at that time) and tried:
use Mmap;
if (@ARGV) {
open(STDIN, $ARGV[0]) or die "$ARGV[0]: $!\n";
}
mmap($data, 0, PROT_READ, MAP_SHARED, \*STDIN) or die "mmap: $!\n";
$count = $data =~ tr/\n//;
print "$count\n";
only to find that tr/// writes the translated characters to the
string even when it's the identity transformation (i.e. you're only
using tr/// to count). That means you can't use tr/// to count
readonly strings which is what mmap gives you (unless you use
"...PROT_READ|PROT_WRITE, MAP_SHARED|MAP_PRIVATE..." but you'd then
get a private copy of all the file which you don't want).
So I've fixed perl :-)
tr/// now doesn't write to its target if you're only using it for
counting. Now the above mmap count takes 1.9 secs for the 1.5 million
line 15 MB file ("wc -l" takes 1.38 secs) and 2.3 for the 30000 line
20 MB file ("wc -l" takes 1.0 secs). Those perl times include a 0.7
second startup penalty without which perl is faster or about as fast
as wc. I think that's probably about as fast you can get it in perl.
--Malcolm
--
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Oxford University Computing Services
"I permitted that as a demonstration of futility" --Grey Roger
------------------------------
Date: 11 Dec 1997 10:46:12 GMT
From: jgreen@nimr.mrc.ac.uk (John Green)
Subject: Re: Problem with Blat in perl script
Message-Id: <66og9k$qam$1@niobium.hgmp.mrc.ac.uk>
In article <65g5nl$14l$1@orthanc.reference.com>, amhardin@erols.com says...
>
>I am running perl scripts on an NT server. I am having a problem
>with one of my scripts that registers them for our system then
>presents a form to them for additional information. At the end
>of the script (after all the HTML is completed) I make a call
>to BLAT to send the user an email with the registration information.
>The email is working fine, but the problem is that in the
>HTML I am getting a message right in the middle of my form which
>reads: Sending C:\WINNT\blt55.tmp to xxxx@erols.com Subject:
>xxxxx Password Login name is xxxx@erols.com where the xxxx is
>data the user entered previously.
What you are seeing is the confirmation message generated by BLAT.
Try using the "-q" option in the BLAT command line. This turns off
all output messages.
John Green - NIMR - U.K.
------------------------------
Date: Thu, 11 Dec 1997 03:21:41 -0500
From: Acid Bastard <acid@fuse.net>
Subject: re:Perl for windows 95
Message-Id: <348FA295.37CA0091@fuse.net>
Need help.
Perl for windows 95 won't work I tried redownloading and so forth but it
still won't work.
This is what it does the program box comes up and I type in my commands
but nothing happens.
_ab
------------------------------
Date: Thu, 11 Dec 1997 05:21:23 -0600
From: jocham@cris.com
Subject: real uid cgiwrap error
Message-Id: <881838979.341639170@dejanews.com>
I have a web site that has an order page. The order page was set up by
someone else as a secure page. They created a program that I use daily
for checking orders. Now, all of a sudden, when I check orders, I get
the following response: CGIwrap Error: Real UID could not be changed! I
went into the order page and tried to place a "test" order, and when I
clicked "submit," I got the same response, CGIwrap Error: Real UID could
not be changed! What does this mean? I cannot reach the person that
implemented this order page for me.
Thanks for any help anyone can give me. I am desperate and loosing $
while order page isn't working.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 11 Dec 1997 01:19:22 -0600
From: scribble@tekka.wwa.com (Tushar Samant)
Subject: Re: recursive regex?
Message-Id: <66o45q$hmo@tekka.wwa.com>
coleman@library.ucsf.edu writes:
>For example, say I have user's home directories, and I am getting ready to
>change the path to perl. I want to know who all has "#!/usr/local/bin/perl"
>so that I might later change it.
Use pfind.
<http://www.perl.org/CPAN/authors/Ilya_Zakharevich/scripts/pfind.gz>.
------------------------------
Date: Thu, 11 Dec 1997 11:06:39 +0000
From: Adrian Lester <alester@bfsec.bt.co.uk>
Subject: Re: removing duplicate entries from the PATH variable
Message-Id: <348FC93F.4DE1@bfsec.bt.co.uk>
Thanks for the responses folks.
Both the solutions posted to the group gave the same result: There
was one directory still duplicated in the output. I worked out
that it was a pesky <CR> at the end of the input which was
causing the diffs. A wee chomp() sorted that one!
Adrian
alester@bfsec.bt.co.uk
------------------------------
Date: 11 Dec 1997 02:22:17 -0600
From: scribble@tekka.wwa.com (Tushar Samant)
Subject: Re: Review of CGI/Perl book
Message-Id: <66o7rp$7ju@tekka.wwa.com>
hans.schrader@geol.uib.no writes:
>In depth review of the newest cgi-perl book:
>CGI/Perl CookBook by Craig Patchett and Matthew Wright published
>by Wiley is available at this location:
>URL="http://hjs.geol.uib.no/SandBox/CookBook/cookbookpepper.shtml"
Let me first admit to one thing; I need the catharsis that only
a frank public admission will bring. This book has haunted me for
three days now. It started right here on this group; but everywhere
I go, I see its lurid traces. I read news, I surf the web, I go to
bookstores, I ask for help, and there it is. It's incredible how
everyone is recommending this extraordinary book for the fulfilment
of one's web dreams. It has arrived. Every hacker born in this
decade will grow up with an instinctive feel for the CGI/Perl
cookbook, or he will be no hacker. It is a defining and seminal
document, the Knuth I, II, and III of the Web, and I feel like a
deer in its headlights.
Therefore I think you will forgive me if I went and looked at your
review. Hans, one could go on and split hair about technicalities
and argue endlessly about minor details. But I will not do that --
because I have another side, I am afraid -- that of a compassionate,
even sensitive, human being. Brother and comrade "Hans", let me
freely and candidly say this -- I Feel Your Pain.
Please! No argument. We only waste more time. I am actuated by an
idealistic fervour. From now I will put my modest free time into
modest free CGI programs -- which DO use Perl 5, do NOT hurt
intelligences by insult, DO have requirements and learning curves,
but are still recipes. I appeal to everyone to write a script which
will do one Matt Wright function better and more easily. Let us get
rid of the pain.
------------------------------
Date: Thu, 11 Dec 1997 04:12:02 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Review of CGI/Perl book
Message-Id: <comdog-ya02408000R1112970412020001@news.panix.com>
[follow-ups set]
In article <66o7rp$7ju@tekka.wwa.com>, scribble@tekka.wwa.com (Tushar Samant) wrote:
>hans.schrader@geol.uib.no writes:
>>In depth review of the newest cgi-perl book:
>>CGI/Perl CookBook by Craig Patchett and Matthew Wright published
>>by Wiley is available at this location:
>>URL="http://hjs.geol.uib.no/SandBox/CookBook/cookbookpepper.shtml"
>It's incredible how
>everyone is recommending this extraordinary book for the fulfilment
>of one's web dreams. It has arrived. Every hacker born in this
>decade will grow up with an instinctive feel for the CGI/Perl
>cookbook, or he will be no hacker.
well, everyone excluding Tom C. and me is suppose.
it's a rather bold assertation that this book is requisite for
hacker-dom though.
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 10 Dec 1997 23:29:28 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: "Calle ]sman" <md4calle@mdstud.chalmers.se>
Subject: Re: running perl with cgi on a NT?
Message-Id: <348F9658.92AD69E@sirius.com>
Calle ]sman wrote:
>
> I wonder if someone want to share experience with running
> some cgi-scripts on a NT-webserver.
I have PWS (M$), WebSite (O'Rielly), Xitami (Imatix) and
Jigsaw (W3C) running on my NT. All were free. I don't
know if Jigsaw does Perl CGI since it is entirely Java based.
The other three do and I have gotten most of Lincoln Stein's
demo's from CGI.pm running under each server.
------------------------------
Date: 9 Dec 1997 16:12:50 GMT
From: varnavas@ny.ubs.com (Frank Varnavas)
Subject: Re: Simple/small socket script doesn't work
Message-Id: <66jqm2$qmh$1@ns2.ny.ubs.com>
In the telnet equivalent you sent a "\n" as
well, have you tried adding that to your print statement?
Frank V.
Atif Ahmad Khan (aak2@Ra.MsState.Edu) wrote:
:
: I wrote this small perl script to connect to an echo server and
: send some string and get that string back. But there's a small
: problem. It sits there and waits for the sever to close connection
: before going on.
:
: #!/usr/bin/perl -w
:
: use IO::Socket ;
:
: $remote = IO::Socket::INET->new(
: Proto => "tcp",
: PeerAddr => "ra.msstate.edu",
: PeerPort => "7",
: )
: or die "cannot connect to host" ;
:
: $remote->autoflush(1) ;
:
: print $remote "hello world";
:
: print <$remote> ;
:
: close $remote ;
:
: Does anyone know of a way to make it not wait for closing of the
: connection? Any other clean solution(s)?
:
: A telnet connection works fine, but I need to automate this:
:
: bash% telnet ra.msstate.edu 7
: Trying 130.18.80.10...
: Connected to ra.msstate.edu.
: Escape character is '^]'.
: Hello World
: Hello World
: ^]q
:
: telnet> q
: Connection closed.
:
: Also the above perl script works fine with a daytime server.
:
: Thanks very much for any help that you can provide.
:
: Atif Khan
: aak2@ra.msstate.edu
--
-----------------------------------------------------------
Frank A.Varnavas Email: varnavas@ny.ubs.com
Union Bank of Switzerland Phone: 212-821-4297
299 Park Avenue
New York, NY, 10171
------------------------------
Date: 11 Dec 1997 01:29:10 -0600
From: scribble@tekka.wwa.com (Tushar Samant)
Subject: Re: There's More Than One Way?
Message-Id: <66o4o6$i6q@tekka.wwa.com>
comdog@computerdog.com writes:
>so far it must either be proved by exhaustion (using Perl for every
>problem in the set), or disproved by a single counterexample (finding
>one problem Perl can't handle).
I disagree, the statement can be proved very easily by benchmarking
5 examples. If someone wants really rigorous proofs you might have
to collect 5 expert opinions and get 5 articles written in computer
magazines with 5 pie charts and 5 screen shots apiece.
Welcome to real life, counterexample boy!
------------------------------
Date: Thu, 11 Dec 1997 02:52:21 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: There's More Than One Way?
Message-Id: <comdog-ya02408000R1112970252210001@news.panix.com>
In article <66o4o6$i6q@tekka.wwa.com>, scribble@tekka.wwa.com (Tushar Samant) wrote:
>comdog@computerdog.com writes:
>>so far it must either be proved by exhaustion (using Perl for every
>>problem in the set), or disproved by a single counterexample (finding
>>one problem Perl can't handle).
>
>I disagree, the statement can be proved very easily by benchmarking
>5 examples. If someone wants really rigorous proofs you might have
>to collect 5 expert opinions and get 5 articles written in computer
>magazines with 5 pie charts and 5 screen shots apiece.
how does benchmarking five examples prove anything about the problem
space addressed by Perl? let's remember that opinions have no place
in such proofs. if you want unjustified opinions, go to Internet World :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 10 Dec 1997 23:37:13 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: Andrew Wood <andrew.wood@cableol.co.uk>
Subject: Re: using PERL with Personal Web server under 95
Message-Id: <348F9829.4DDCF9F0@sirius.com>
> I have installed Front Page on my Windows 95 machine and have PERL on
> it.
>
> I have changed the first line of my cgi script to reflect the new
> location of perl from its unix form to its Windows form.
>
> I am still getting HTTP/1.0 500 Server errors trying to run the code.
>
I recently answered this question in:
comp.infosystems.www.servers.ms-windows
------------------------------
Date: Thu, 11 Dec 1997 12:01:29 +0000
From: Colin Foster <admin@alphaweb.co.uk>
Subject: Re: using PERL with Personal Web server under 95
Message-Id: <ctqNLHAZY9j0EwgJ@alphaweb.co.uk>
In article <348F9829.4DDCF9F0@sirius.com>, Jim Bowlin
<bowlin@sirius.com> writes
>> I have installed Front Page on my Windows 95 machine and have PERL on
>> it.
>>
>> I have changed the first line of my cgi script to reflect the new
>> location of perl from its unix form to its Windows form.
>>
>> I am still getting HTTP/1.0 500 Server errors trying to run the code.
>>
>
>I recently answered this question in:
>
>comp.infosystems.www.servers.ms-windows
Sorry, I cannot find your answer using dejanews. Please would you repost
here.
Many thanks.
--
Colin Foster
------------------------------
Date: Thu, 11 Dec 1997 06:25:51 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: What is wrong with this script?
Message-Id: <comdog-ya02408000R1112970625510001@news.panix.com>
In article <66lel9$3fg$1@texas.nwlink.com>, "Larry Yurdin" <lyurdin@nwlink.com> wrote:
>The following script in Perl 5.003 with 755 permissions and the correct path
>on my server has been checked by my instructor who said the syntax is fine.
your instructor missed the very obvious error pointed to by the error
message. if perl says something is wrong, it's good to beleive it.
>However, it still gets this error message on the Perl Script Validator on my
>commercial server:
>
> Bare word found where operator expected, line 41 near ".
>
>Line 41 is: print<< "EndFound";
>
>The script follows. Any feedback on what I am doing wrong would be much
>appreciated.
>#!/usr/local/bin/perl5.003
no -w switch
you didn't "use strict;"
>require('cgi-lib.pl');
you're using an antiquated library rather than CGI.pm
>print << "EndFound";
you have a space between the << and the identifier. you can't have
that.
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
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 1453
**************************************