[7532] in Perl-Users-Digest
Perl-Users Digest, Issue: 1159 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 11 05:08:02 1997
Date: Sat, 11 Oct 97 02:00:29 -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 Sat, 11 Oct 1997 Volume: 8 Number: 1159
Today's topics:
Are there problems using back quotes on Win95? <david_ransier@intercept.com>
Re: Can WEBGET work with Perl for Win95? <pvhp@forte.com>
chmod problem <whitek@thegrid.net>
Formal syntax descriptions for data formats? <cnwetzel@linguistik.uni-erlangen.de>
HELP PLEASE!!! <u1436039@csi.uottawa.ca>
Help! <u1436039@csi.uottawa.ca>
Re: Help: Regular Expression Substitution (Ilya Zakharevich)
In need the return value of $^O on SUN and Solaris <david_ransier@intercept.com>
Re: inheriting filehandles from Win32::Process::Create <joshb@kadence.kom>
Re: is there a GUI for MacPerl scripts? <pvhp@forte.com>
Re: Need help with logic <merlyn@stonehenge.com>
Re: Need To Clear Screen With Perl 5...? <ase@seanet.com>
Re: need tricky regex (brian d foy)
Re: need tricky regex <ajohnson@gpu.srv.ualberta.ca>
Re: Passing arguments to a script in HTML (brian d foy)
Perl 5.004_03, DB, & Auspex (Keith Pyle)
perl's speed in CGI <jfbe@vir.com>
Re: Posting to a Newsgroup with a Perl Script. (O'Shaughnessy Evans)
Searchable Database. <adorsett@gonzaga.edu>
Re: Seeing if service is alive, Is this a good idea? (Eric Bohlman)
Server-Push and MS IE <matthias.hellmund@nienburg-weser.de>
truncate() & FileHandle(s) <oboyle@cs.purdue.edu>
Varargs mapping in xs (Lloyd Zusman)
Re: Why the ambiguity? (brian d foy)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Oct 1997 01:03:15 GMT
From: "David Ransier" <david_ransier@intercept.com>
Subject: Are there problems using back quotes on Win95?
Message-Id: <01bcd5e1$31578b30$714b62c7@itibit>
Are there problems using back quotes on Win95?
I have written some Perl programs that run fine on Unix (version 5.004) and
WinNT (Both ActiveState and the Gurusamy Surathy port).
I seem to be having a problem on Win95 with statements like:
$var = `command shell command goes here`;
$var does not get any return values.
I've looked through the FAQ and scanned Learning Perl on Win32 book. I
can't find anything that says it behaves different between Win95 or WinNT.
Any ideas?
Thanks,
David R
------------------------------------------------------------------------
_/_/_/ _/_/_/_/_/ _/_/_/ David M. Ransier
_/ _/ _/ Senior Consultant
_/ _/ _/ Intercept Technology Inc.
_/ _/ _/ David_Ransier@Intercept.com
_/ _/ _/ 503-692-0111 www.intercept.com
_/_/_/ _/ _/_/_/ 503-691-9535 (fax)
404-352-0111 (Corp Headquarters)
------------------------------
Date: Sat, 11 Oct 1997 00:46:48 -0700
From: Peter Prymmer <pvhp@forte.com>
To: Tom Warneke <twarneke@cisco.com>
Subject: Re: Can WEBGET work with Perl for Win95?
Message-Id: <343F2EE8.1384@forte.com>
Tom Warneke wrote:
>
> Hi,
>
> I use webget on Unix with great success.
>
> It doesn't work with Perl for Win95. Any suggestions on configuration
> changes or wether it can be made to work at all in Windows?
I am not too sure about webget since I have never used it (its a
perl4ish script isn't it?). At any rate I have used the following
with Gurusamy Sarathy's binary distribution of Perl + LWP on Windows
(I was using win NT 4.0 at the time but this does work with Win95 I am
told):
C:\> perl -MLWP::Simple -e "getprint(shift())"
http://www.whereever.com/
notice that unlike under a typical unix shell I had to use double
quotation marks
"" to enclose the argument to perl's -e switch.
Hope that helps.
Peter Prymmer
------------------------------
Date: 10 Oct 1997 22:43:29 GMT
From: "Justin White" <whitek@thegrid.net>
Subject: chmod problem
Message-Id: <01bcd697$842bccc0$21653cd1@200cyrix.thegrid.net>
Hi,
Thanks for responding. I do have cgi tutorials, I've looked up chmod at
deja news, I've read manpages on POSIX and perlfunc, I changed the mode on
the file I'm trying to write to in every way I can find, and everything
works but the writing to file part. Here's what's going on:
I parse the form, which works because the mail functions in the script work
and everything is translated OK. Here's the part that doesn't work
&ParseForm();
open(FILE,">>/etc/VirtualData") || die "$!";
print FILE "$FORM{'First Req'}~$FORM{'Last Req'}~$FORM{'Email'}\n";
close(FILE);
When I fill out the form and submit it, if I open the FILE without the two
pipe arrows ">>", all the mail works but, of coarse, nothing is printed to
the FILE. If I add the two ">>" when I view the
/usr/var/log/httpd/error_log file, I get the error:
Permission denied at /var/www/cgi-bin/domain.cgi line 13.
[Fri Oct 10 14:40:57 1997] access to /var/www/cgi-bin/domain.cgi failed
for 209.
60.101.33, reason: Premature end of script headers
I changed the mode as follows:
chmod 755 VirtualData - and - chmod =r+w VirtualData - and - chmod r+w,+X
VirtualData
and still get the permission denied error.
I'm sure I'll figure it out eventually, but the sooner the better. Thanks
for any help.
Justin
------------------------------
Date: 10 Oct 1997 22:00:32 -0400
From: Christian Wetzel <cnwetzel@linguistik.uni-erlangen.de>
Subject: Formal syntax descriptions for data formats?
Message-Id: <97-10-047@comp.compilers>
Keywords: syntax, question, comment
Hello,
I'm searching for links to places with formal syntax
descriptions of data formats, preferably text-oriented
(non-binary) formats for
- electronic documents (LaTeX, troff, ...)
- linguistic applications (online dictionaries, tagged corpora, ...)
- log files (web server logs, system logs, ...)
- bibliographies
- ...,
but no programming languages. Can you help me?
Any connection of this topic to SGML-related stuff would
also be interesting to me.
I'm planning to build a converter generator workbench in Perl/Yacc for
(text-oriented) data formats. The problem with most data format
manuals (like those from Guenter Born) is that their descriptions are
informal, and BNF-like descriptions like the RTF (Rich Text Format)
Specification are hard to find.
If you know of similar projects, please let me know.
Thank you in advance,
Christian
[It is my impression that a formal syntax rarely suffices to parse
real documents, unfortunately. -John]
--
Send compilers articles to compilers@iecc.com,
meta-mail to compilers-request@iecc.com.
------------------------------
Date: Fri, 10 Oct 1997 19:49:17 -0400
From: u1436039 <u1436039@csi.uottawa.ca>
Subject: HELP PLEASE!!!
Message-Id: <61mep4$17v0$1@mercury.cc.uottawa.ca>
We are beginners with PERL and we need to write a program to make search
for a certain string.
Actually, we started to use the Command " m // " but we just figured
out how to find such a string as the following situation:
string : word1 and word2 or word3
| |____ Boolean
opreator
|______Boolean operator
we used the following command:
print if m/word1.*word2|word2.*word1|word3/
We need to write a string ( query ) like this:
print lines with word1 and word2 or word3 andnot word4
|_____ How to write the code for this boolean
Thank you in advance.
------------------------------
Date: Fri, 10 Oct 1997 19:55:43 -0400
From: John <u1436039@csi.uottawa.ca>
Subject: Help!
Message-Id: <61mf56$17v0$2@mercury.cc.uottawa.ca>
We are beginners with PERL and we need to write a program to make search
for a certain string.
Actually, we started to use the Command " m // " but we just figured
out how to find such a string as the following situation:
string : word1 and word2 or word3
| |____ Boolean
opreator
|______Boolean operator
we used the following command:
print if m/word1.*word2|word2.*word1|word3/
We need to write a string ( query ) like this:
print lines with word1 and word2 or word3 andnot word4
|_____ How to write the code for this boolean
Thanks in advance.
------------------------------
Date: 11 Oct 1997 02:16:20 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Help: Regular Expression Substitution
Message-Id: <61mnhk$i73$1@agate.berkeley.edu>
In article <eli$9710081229@qz.little-neck.ny.us>,
Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote:
> How did Emacs do on the sig? :^)
>
> #!/usr/bin/perl -- -*- my ny.pm sig -*-
> $_=$^ ;s;s;sss;;s^.^ju^&&s&P&,\n&&&(s(_..)(ers)||s|^|^^|)&&s(T)(q(st%eg))eg;
> s<.(o).><$& new 1$$>i+s+\dst.+$a--||reverse(q(rep k))+ge;s*%.+u* so+*i;s=\++
> ="me"=mex&&s%ege%l$"hke%;$a||s/^\S+ /\/\//;s;\d+;yor;;s[KE]<ac$&>i;print $_;
The newer version I have here can deal with everything but s[KE]<ac$&>i.
Another rainy day, and can fix this too :-(.
Ilya
------------------------------
Date: 10 Oct 1997 23:28:08 GMT
From: "David Ransier" <david_ransier@intercept.com>
Subject: In need the return value of $^O on SUN and Solaris
Message-Id: <01bcd5d3$eeb0a120$714b62c7@itibit>
I'm doing a perl program that needs to know which platform it's running on
so I can determine the location of "xterm" on each.
I have only an HP-UX machine. Although there are other important platforms,
the primary ones I'm interested in, in addition to HP, is SunOS and
Solaris.
If you have one of these platforms, would you please run the following
script and tell me what the return value is:
perl -e "print $^O"
Also, if you do "which xterm" what is the location of xterm on that
machine.
Thanks,
David R
------------------------------------------------------------------------
_/_/_/ _/_/_/_/_/ _/_/_/ David M. Ransier
_/ _/ _/ Senior Consultant
_/ _/ _/ Intercept Technology Inc.
_/ _/ _/ David_Ransier@Intercept.com
_/ _/ _/ 503-692-0111 www.intercept.com
_/_/_/ _/ _/_/_/ 503-691-9535 (fax)
404-352-0111 (Corp Headquarters)
------------------------------
Date: Thu, 9 Oct 1997 11:28:05 -0700
From: "Josh Baudhuin" <joshb@kadence.kom>
Subject: Re: inheriting filehandles from Win32::Process::Create
Message-Id: <61j7nt$ag5$1@news.cadence.com>
Uh, very likely the spawned perl task doesn't inherit the filehandles of the
previous perl script. The Create() API (::CreateProcess()) is talking about
handles in the Win32 sense of the word, not in the perl sense of the word...
I'm not sure if you CAN refer to the handles the spawning process is giving
to the spawned, unless you use lower-level I/O to which you'd pass the
actual Win32 HANDLE.
You SHOULD be able, at least, to give the child process your current
standard in/out/err, if that helps.
Mike Reiter wrote in article <343D204A.167EB0E7@research.att.com>...
>Please respond to "reiter@research.att.com".
>
>I'm using standard Perl 5.004 for Win32 on a Windows 95 machine. I am
>trying to use Win32::Process::Create to spawn a process from my "main"
>program. The call looks like this:
>
>Win32::Process::Create($Process, 'c:\perl\bin\perl.exe',
> 'perl c:\myprograms\child.pl',
> 1, DETACHED_PROCESS, ".") or die "create: $!";
>
>According to the docs, the "1" in the fourth argument enables the
>child process to inherit all inheritable open handles from the
>parent process, including I/O handles, socket handles, etc. I can
>verify that the child process is created, but I'm having trouble
>making use of the filehandles that it supposedly inherits. For
>example, if before the above call the parent executes
>
> open TEST, ">test";
>
>then a call like
>
> print TEST "This is a test.\n";
>
>in the child apparently fails (the "test" file remains empty). Can
>anyone tell me what I'm doing wrong??
>
>Many thanks in advance. Please respond to "reiter@research.att.com".
>
>- Mike Reiter
------------------------------
Date: Sat, 11 Oct 1997 00:52:22 -0700
From: Peter Prymmer <pvhp@forte.com>
To: Gert Jan Verhoog <gerti@xs4all.nl>
Subject: Re: is there a GUI for MacPerl scripts?
Message-Id: <343F3036.5899@forte.com>
Gert Jan Verhoog wrote:
>
> I'm probably not the first one with this question, but since I couldn't
> find anything relevant on the internet, I'll ask it here anyway:
>
> Is there any work done on a Perl/tk for the Macintosh, or is it possible
> to let MacPerl interact with wish or the Mac X-server MI/X for example?
>
> In other words: I would like my perl scripts to have a graphical
> interface, but the scripts will also have to run in a unix world without
> too much modification...
>
> --
> Gert Jan Verhoog | - No brains, total freedom -
The person who has done the most work on Perl/Tk has taken up the
project of combining Tk 8 with Perl as of this fall. However, UNIX
and Windows (95 && NT) are a priority with him and he would need help
with a Macintosh port.
MacPerl supports a rather extensive collection of Mac specific GUI
elements like File selectors and such. There is also Matthius' Cookbook
of more enriched MacPerl::* GUIs that are only a few clicks away from
his MacPerl home page.
Good luck.
Peter Prymmer
------------------------------
Date: 10 Oct 1997 15:13:22 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: dwhill@atl.mindspring.com
Subject: Re: Need help with logic
Message-Id: <8cd8ld1d31.fsf@gadget.cscaper.com>
>>>>> "dwhill" == dwhill <dwhill@atl.mindspring.com> writes:
dwhill> Never said I was quick.
dwhill> I have a large text file containing reports delimited with a BEGIN
dwhill> keyword and an END keyword. A keyword "HARDWARE" is contained
dwhill> within some of these reports. Those I need to print to unique files.
dwhill> One report to a unique file name. I am obviously new at this. But, I
dwhill> have read and looked and can't find a good example. I can hack
dwhill> thru the syntax stuff but the logic is killin' me. Any hints would be
dwhill> greatly appreciated.
This sounds amazingly similar to something that I answered about six
months ago. Have you considered Dejanews?
But since I have a few spare minutes (rare!), let's try it from scratch:
while(<>) {
$where = /BEGIN/../END/; # looking for this range
if ($where == 1) { # at beginning
@report = ();
$seen_hardware = 0;
} elsif ($where =~ /E/) { # at end
if ($seen_hardware) { # one we want?
open UNIQUE, ">file.".++$n or die "Cannot create $n: $!";
print UNIQUE @report;
close UNIQUE;
}
} elsif ($where) { # somewhere in middle
push @report, $_; # accumulate
$seen_hardware = 1 if /HARDWARE/; # note the keyword
}
}
There. What was so hard about that? Pretty much transcribed directly
from your request. Learn to use "..", and you can get a lot of stuff
done.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 325 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
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@ora.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: Fri, 10 Oct 1997 21:28:24 -0700
From: "Allen Evenson" <ase@seanet.com>
Subject: Re: Need To Clear Screen With Perl 5...?
Message-Id: <61mv8q$9th@q.seanet.com>
=20
>
>Todd Carlton wrote:
>>=20
>> I have two related questions. Both should be EASY for experienced =
perl
>> people...
>>=20
>> (1) I'm converting some old basic programs to perl to run over telnet
>> sessions (don't ask...) and need to be able to clear the screen... =
Any idea
>> what the perl clear screen command is?!?!? (DOS=3Dcls linux=3Dclear)
>
>You should probably check out some of the Term:: modules in the =
standard
>distribution and available on CPAN for, I hope, a terminal-independent
>method to clear the screen. Not sure exactly what you should look for,
>as I've never done this kind of thing, but if you poke around, I'm sure
>you'll find something useful.
>
Another simple and somewhat portable way is to use ANSI escape =
sequnces.. ie
perl -e 'print "\e[2J";' (for dos ansi.sys must be installed)
[snip]
>>=20
>> -Todd Carlton
------------------------------
Date: Fri, 10 Oct 1997 18:04:15 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: need tricky regex
Message-Id: <comdog-ya02408000R1010971804150001@news.panix.com>
In article <eli$9710101700@qz.little-neck.ny.us>, Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote:
>Matthew Reimer <mreimer@vpop.net> wrote:
>> I want to capture the text between the <H3></H3> tags, and the HREF, if
>> there is not another <H3> tag between the first <H3> and the <A
>> HREF...>.
>
>This is very tricky with regexps, unless you split the input on
>each /<H3>/.
>
>> Using the sample text below, this should return ('Title 1', 'abc.html')
>> and ('Title 3', 'def.html').
>I tried m:<H3>([^>]*)</H3>(?:(?!.*?<H3>).*?)<A HREF=(.*?)>: but that
>did not work, so I'd recomend junking *? altogether.
[snip example text. it's at the end of my script in the DATA]
>m:<H3>([^>]*)</H3>(?:[^<]|<(?!H3))*<A HREF=(.*?)>:misg
[quick question: why are you using the m and s modifiers together,
other than for symmeterical typography? ;)]
my regex is a bit different, but i think that we agree that splitting
on <h3> is much more efficient (processor-wise, maybe not storage-wise).
i watched my regex do its thing through the debugger and there were
many, many screen fulls from the matching operator.
i made no attempt to benchmark either expression, so i have no clue
how efficient mine is compared to Eli's. i've thought about this
enough for one day :).
#!/usr/bin/perl -w
local $/ = undef;
$_ = <DATA>;
while(m;#this part matches the headline tag
<h3> #start with an headline tag
(.*?) #anything (including \n)
</h3> #the closing tag
#this part matches anything up to the next
#headline tag
.*? #anything (including \n)
#here's the tricky part: we match up to the
#start of another headline tag, or to
#something that looks like an anchor
#--notice that if it looks like an anchor
#--the href value goes into $3
# Mastering Regular Expressions, p.228 is helpful
# for this sort of thing
# see <URL:http://www.oreilly.com> for book info.
(?= <h |
<a #the start of an anchor tag
\s+ #at least one whitespace character
href #the hypertext reference attribute
\s*=\s* #an equal sign possibly surrounded by whitespace
(["']?) #maybe a quote thing
([^"'\s>]+) #not anything that closes the quote or tag
\2? #a back reference to the quote thing - optional
[^>]* #everything else in the anchor tag (e.g. JavaScript)
> #the end bracket on the anchor tag
) #end of the forward look ahead
;xisg
)
{
$hash{$1} = $3 if $3;
}
foreach (keys %hash)
{
print "$_: $hash{$_}\n";
}
__DATA__
<H3>Title 1</H3>
ipsum <i>lorem</i>...
<a href="abc.html">qwerty</a>
<H3>Title 2</H3>
multiple lines of <b>text</b> and tags...
<H3>Title 3</H3>
more text and <b>tags</b>...
<a href="def.html">asdfg</a>
--
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: Fri, 10 Oct 1997 18:20:49 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: need tricky regex
Message-Id: <343EC661.18351B5F@gpu.srv.ualberta.ca>
Matthew Reimer wrote:
>
> I need a single regex to pull out two pieces of information from a
> stream that looks like the text at the end of this message.
>
> I want to capture the text between the <H3></H3> tags, and the HREF, if
> there is not another <H3> tag between the first <H3> and the <A
> HREF...>.
>
> Using the sample text below, this should return ('Title 1', 'abc.html')
> and ('Title 3', 'def.html').
>
> In my program, I read a web page into a string, and match the string
> like this:
>
> while ($page =~ /$regex/misg) {
> do something with $1 (title) and $2 (href)
> }
>
> The closest I can get is the regex below, which doesn't work properly:
>
> <H3>(*?)</H3>.*?<A HREF=(.*?)>
>
you could try this:
#!/usr/bin/perl -w
$page=join("",<DATA>);
$regex='<H3>([^<]*)</H3>(?:.(?!<H3>))*?<A HREF=(.*?)>';
while ($page=~/$regex/misg) {
print "title=$1, href=$2\n";
}
__DATA__
<H3>Title 1</H3>
ipsum <i>lorem</i>...
<a href="abc.html">qwerty</a>
<H3>Title 2</H3>
multiple lines of <b>text</b> and tags...
<H3>Title 3</H3>
more text and <b>tags</b>...
<a href="def.html">asdfg</a>
----------------
some adjustment may be necessary for other data.
regards
andrew
------------------------------
Date: Fri, 10 Oct 1997 23:06:32 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Passing arguments to a script in HTML
Message-Id: <comdog-ya02408000R1010972306320001@news.panix.com>
In article <01bcd5c0$b2f99730$7664f893@forda>, "Allie Ford" <forda@monroe.army.mil> wrote:
>Trying to pass arguments obtained in an HTML form to a Perl script in NT.
>
>Tested the script in command mode and the script can print the arguments.
>But when arguments are passed to the script in a Form Action tag, the
>script prints cannot see the arguments and prints empty arguments.
>
>Using IIS 3.0 and <FORM ACTION="/scripts/HelloWorld.pl arg1 arg2"
>METHOD="GET">
<form action="/scripts/HelloWorld.pl?arg1+arg2">
or many other forms depending on what you are doing. these arguments
will show up in the query string. beware that CGI.pm effectively
concatenates the query string with the HTTP message body, so you won't
be able to tell the difference between the two through the module
(although $ENV{'QUERY_STRING'} is still available and untouched).
good luck :)
--
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: 10 Oct 1997 16:42:24 -0500
From: keith@ibmoto.com (Keith Pyle)
Subject: Perl 5.004_03, DB, & Auspex
Message-Id: <61m7g0$9kp@entropy.ibmoto.com>
Has anyone built Perl 5.004_03 with the Berkeley DB extensions (v1.85) for
an Auspex. We're running Auspex v 1.9Z1 and neither a SunOS 4.1.4 built
version nor a version built directly on the Auspex works for the DB
extensions. Static and dynamic versions of the extensions both fail.
Perl will pass most of the tests, but the following fail due to core
dumps:
lib/db-btree on test 74 of 102 (status of tests 75-102 unknown)
lib/db-recno on test 17 of 66 (status of tests 18-66 unknown)
The following appear to hang:
lib/io_udp on test 3 of 3
If anyone has a successful build and has a config.sh they would be willing
to share, I would like to see what parameters are different than in mine.
--
Keith Pyle
Systems/Network Engineering
Motorola Somerset PowerPC Design Center
keith@ibmoto.com
------------------------------
Date: Fri, 10 Oct 1997 22:31:38 -0400
From: Jean-Francois Beaulieu <jfbe@vir.com>
Subject: perl's speed in CGI
Message-Id: <343EE50A.52F@vir.com>
Hi,
I know little about perl except something I read 5 months ago, and I
forgot the syntax of the language... anyway, this is not relevant today,
it is just that I must adopt a solution among severals and the speed
to access databases is important. I know that CGI's in 'c' are slow
with respect to IIS ISA because a dll is always faster than a .exe,
and I'm still unsure about netdynamic and some other solutions that are
coming from the top of my head... Since perl is a script (as far as I
can remember :-) ) is it possible that CGI in PERL are faster to load
than CGI in C or C++?
The application that I have to do will deal with 50,000 to 100,000
people accessing the same web page at a time sometimes...
Is it much more slowler than CGI in 'c' to EXECUTE after they are
loaded? And what about dbperl ?
Please, email a copy if you respond.
bye.
------------------------------
Date: 11 Oct 1997 02:52:35 GMT
From: shaug@callamer.com (O'Shaughnessy Evans)
Subject: Re: Posting to a Newsgroup with a Perl Script.
Message-Id: <61mplj$lkm$1@ha1.rdc1.occa.home.com>
In article <343D6F25.E875123D@uidaho.edu>,
Brandon Stirling <brandons@uidaho.edu> writes:
> Posting to a Newsgroup with a Perl Script.
>
> This should be an easy task, but I can only find a method to read
> Newsgroups with a perl script.
>
> Can anyone in Perl land give me a starting point for this process?
Check out the Net::NNTP module. There was an article about this sort
of thing in Vol 1, Issue 4 of The Perl Journal... maybe you can find it
on the web site (www.tpj.com).
--
O'Shaughnessy Evans -
http://www.callamer.com/shaug -
UNIX Sys Admin, GST Call America; San Luis Obispo, California -
------------------------------
Date: Fri, 10 Oct 1997 15:54:29 -0700
From: Amy Dorsett <adorsett@gonzaga.edu>
Subject: Searchable Database.
Message-Id: <Pine.HPP.3.95.971010155106.4175D-100000@barney.gonzaga.edu>
I am working on a project which entails implementing a searchable database
via the internet using PERL/CGI. I have programming experience (but
none with PERL CGI) and know my database pretty well but combinig the two
(and learning PERL) is not working...
Do you have any suggestions at all on books, websites or anything else
that may help me get started?
thank you.
------------------------------
Date: Fri, 10 Oct 1997 11:34:25 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Seeing if service is alive, Is this a good idea?
Message-Id: <ebohlmanEHu2tD.Cot@netcom.com>
Thomas Munn (munn@bigfoot.com) wrote:
: I am very new to perl, and have been diligiently reading the CAMEL book,
: anyway: Here's what I want to do:
: Have perl send an http request to the web server, to see if the server is up.
: Do I just send an http get command, then have a timeout? Or is there a built
: in function that will do this automagically?
There's no built-in function to do this, but there *is* a module someone
else has written that has such a function; it's called LWP::Simple, and
it's available at your nearest CPAN site.
Note that you'll actually want to send a HEAD request rather than a GET;
LWP::Simple has such a function.
------------------------------
Date: 10 Oct 1997 23:14:43 GMT
From: "Matthias Hellmund" <matthias.hellmund@nienburg-weser.de>
Subject: Server-Push and MS IE
Message-Id: <01bcd5da$b18e2180$431304c3@o63hutef>
I'd like to have some chat-lines as a datastream via Server-Push. I know,
that there is no new-page-clear with MS IE, but why are lines not printed
out line by line with pauses like with Netscape?!?
My Testscript - nph-out2.pl:
#!/usr/bin/perl
$|=1;
print "HTTP/1.0 200 OK\n"; # Apache-Server!!!
print "Content-Type: multipart/mixed;boundary=ASDFGHJKL\r\n\r\n";
print "--ASDFGHJKL\n";
print "Content-Type: text/html\r\n\r\n";
print "<HTML>\n";
print "<BODY>\n";
sleep 1;
print "<H1>Hihihihi</H1>\n";
print "test\n";
sleep 3;
print "--ASDFGHJKL\n";
sleep 5;
print "Content-Type: text/html\r\n\r\n";
print "<HTML>\n";
print "<BODY>\n";
print "<H1>Hahahaha</H1>\n";
print "$ENV{'SERVER_PROTOCOL'} 200 OK\n";
sleep 2;
print "--ASDFGHJKL\n";
URL: http://195.4.19.9/~hellmund/cgi-bin/nph-out2.pl
Chat-Test: http://195.4.19.9/~hellmund/ghetto-chat.html
Why is everything printed out at the end with MS IE instead as a stream?
I hope anybody out there can help me... (please also via eMail!!!)
CU
Matthias
--
Matthias Hellmund
E-Mail: matthias.hellmund@nienburg-weser.de
Homepage (NEW!): http://www.nienburg-weser.de/~hellmund
------------------------------
Date: 11 Oct 1997 06:21:39 GMT
From: Todd O'Boyle <oboyle@cs.purdue.edu>
Subject: truncate() & FileHandle(s)
Message-Id: <61n5tj$g9@ector.cs.purdue.edu>
I need to truncate a file that I have a FileHandle on. perl's
truncate() does not work, sending me a "No such file or directory" ($!)
when I pass it
my $fh = new FileHandle 'filename', 'r+';
truncate($fh,0);
The FileHandle pod page says:
Due to backwards compatibility, all filehandles resemble
objects of class FileHandle, or actually classes derived
from that class.
I assumed this that FileHandle objects could masqerade as
filehandles, am I not correct? How can I solve this without
slinging backticks?
cheers,
-Todd
--
Key: ftp://csociety.ecn.purdue.edu/pub/oboyle/oboyle.asc
Fingerprint: DA 83 ED B0 48 79 F4 5D B2 4D B0 B7 F1 A3 C1 49
Location: 86 54' 29" W / 40 25' 33" N
------------------------------
Date: 11 Oct 1997 04:55:17 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Varargs mapping in xs
Message-Id: <slrn63tv1p.ft.ljz@ljz.asfast.net>
I'm trying map a C-based varargs function in xs as follows, and I'm
not sure how to proceed. I went through the xs tutorial and the other
xs man pages, and I'm still a bit confused.
There's a function in a C library with the following prototype:
int func(char* file, ...);
I want to call this function directly from Perl, and I want to use xs
to create a mapping in Perl that also takes a variable number of
arguments. I started with this code fragment:
int
func(file, ...)
char * file
CODE:
RETVAL = func( file, <what goes here?> );
OUTPUT:
RETVAL
I know about the 'items' variable, and I know that I can use it to
tell me how many arguments were passed. I also know that I can
reference each individual argument via the ST(n) macro. But I don't
see how I can use ST(n) and 'items' to fill in the <what goes here?>
portion of my code, above. Perhaps I can use ST(n) or some variation
of it to tell the C version of 'func' to use 'file' and everything
else following it on the stack as it arguments ... but if so, I don't
know how to code this.
Any ideas?
Thanks in advance.
--
Lloyd Zusman
ljz@asfast.com
------------------------------
Date: Fri, 10 Oct 1997 23:03:28 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Why the ambiguity?
Message-Id: <comdog-ya02408000R1010972303280001@news.panix.com>
In article <343E967C.42A0@rice.edu>, Arthur Darren Dunham <add@rice.edu> wrote:
>open (FILE, "+>>128_42_${sub}_0");
>
>Now I get a warning that ...
>Ambiguous use of ${sub} resolved to $sub at ....
>
>I was assuming that I could always use ${var} within a
>double-quoted string. Now I'm guessing that this is worrying
>about some sort of referenced hash or anonymous hash that I might
>be trying to define?? Maybe?
remember that sub is a Perl keyword :)
--
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 1159
**************************************