[10239] in Perl-Users-Digest
Perl-Users Digest, Issue: 3832 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 26 17:07:18 1998
Date: Sat, 26 Sep 98 14:00:19 -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, 26 Sep 1998 Volume: 8 Number: 3832
Today's topics:
Best Editor for Perl (under WinNT4) - Syntax Coloring ? (Alec Stewart)
Re: Best Editor for Perl (under WinNT4) - Syntax Colori (clay irving)
CHALLENGE: Fastest algo wins. <pcollins@web.fairfax.com.au>
Re: CHALLENGE: Fastest algo wins. (John Moreno)
Re: CHALLENGE: Fastest algo wins. <michel.prevost@cactuscom.ca_REMOVE_TO_MAIL>
Re: CHALLENGE: Fastest algo wins. <danboo@negia.net>
Re: CHALLENGE: Fastest algo wins. <danboo@negia.net>
Help w/ S.Sol's DB_Manager/Search <phinneas@eskimo.com>
How to log click-thru's for URL's <ah@barentsnett.no>
Re: How to test if a value is a number or a string (Craig Berry)
Re: Internal Server Error (Premature end of script head <lampard@ticnet.com>
M/// problem again... (Hampus Brynolf)
New mailing list for Perl - Win32::GUI users perl@NOSPAM.httptech.com
newbie Perl Program help <caustic@causticinteractive.nospam.com>
Re: pattern match problem <jdf@pobox.com>
Perl Newbie <bridges@brightok.net>
Perl not terminating <michel.prevost@cactuscom.ca_REMOVE_TO_MAIL>
Re: Perl not terminating <eashton@bbnplanet.com>
Re: Perl not terminating <michel.prevost@cactuscom.ca_REMOVE_TO_MAIL>
Re: Perl not terminating (Ilya Zakharevich)
Re: perl tutorial <eashton@bbnplanet.com>
please help with my first perl script markolopa@my-dejanews.com
Re: please help with my first perl script (Mark-Jason Dominus)
POLL: Perl features springing into your face (Ilya Zakharevich)
Search Engine Woes <criggs@powernet.net>
Re: Shell for testing Perl/CGI scripts!? <eashton@bbnplanet.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 26 Sep 1998 17:55:01 GMT
From: alec@venus.co.uk (Alec Stewart)
Subject: Best Editor for Perl (under WinNT4) - Syntax Coloring ?
Message-Id: <360d29c5.5512867@news.demon.co.uk>
Hi,
Can anyone recommend a decent Editor for Perl (5) ?
- Ideally something with Syntax Coloring
(like KEDIT seems to do for other languages...)
I am running under WinNT 4 (SP3).
Yrs
Alec
------------------------------
Date: 26 Sep 1998 14:12:45 -0400
From: clay@panix.com (clay irving)
Subject: Re: Best Editor for Perl (under WinNT4) - Syntax Coloring ?
Message-Id: <6ujaqt$ssl@panix.com>
In <360d29c5.5512867@news.demon.co.uk> alec@venus.co.uk (Alec Stewart) writes:
>Can anyone recommend a decent Editor for Perl (5) ?
>- Ideally something with Syntax Coloring
>(like KEDIT seems to do for other languages...)
>I am running under WinNT 4 (SP3).
Check the "editors" section of Perl Reference <http://reference/perl.com>,
--
clay irving
clay@panix.com
http://www.panix.com/~clay/
------------------------------
Date: Sat, 26 Sep 1998 17:38:15 +0000
From: Patrick Collins <pcollins@web.fairfax.com.au>
Subject: CHALLENGE: Fastest algo wins.
Message-Id: <360D2687.E88CDA5A@web.fairfax.com.au>
Hi all,
A simple little string manipulating brainteaser for y'all. Well, I
thought it was simple, but ended up messing around for ages.
---
I have a string which contains a word, called "REGO". Possibly more than
once. I'd like to break the string up around the word including 3 words
either side. So the string gets broken into three separate strings. That
means then that the middle string will always be seven words.
Example:
$string = "TOYOTA Corolla 1985 auto sedan 12 mths REGO good cond $3800
Call Phil (02) 6558 2679"
($beginning,$middle,$end) = &black_box( $string );
The values become:
$beginning: "TOYOTA Corolla 1985 auto ";
$middle : "sedan 12 mths REGO good cond $3800 ";
$end : "[PLATE] Ph (02) 6558 2679";
I have a working solution using split and messing around with array
positions and grep and... well... it was yuk. It is too slow. Can anyone
think of a faster solution maybe with regexp's?
Thanks in advance.
Patrick Collins.
------------------------------
Date: Sat, 26 Sep 1998 14:30:24 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: CHALLENGE: Fastest algo wins.
Message-Id: <1dfyvxv.1qaaopo1kulkf0N@roxboro0-039.dyn.interpath.net>
Patrick Collins <pcollins@web.fairfax.com.au> wrote:
> Hi all,
>
> A simple little string manipulating brainteaser for y'all. Well, I
> thought it was simple, but ended up messing around for ages.
>
> ---
> I have a string which contains a word, called "REGO". Possibly more than
> once. I'd like to break the string up around the word including 3 words
> either side. So the string gets broken into three separate strings. That
> means then that the middle string will always be seven words.
>
> Example:
>
> $string = "TOYOTA Corolla 1985 auto sedan 12 mths REGO good cond $3800
> Call Phil (02) 6558 2679"
>
> ($beginning,$middle,$end) = &black_box( $string );
>
> The values become:
> $beginning: "TOYOTA Corolla 1985 auto ";
> $middle : "sedan 12 mths REGO good cond $3800 ";
> $end : "[PLATE] Ph (02) 6558 2679";
>
> I have a working solution using split and messing around with array
> positions and grep and... well... it was yuk. It is too slow. Can anyone
> think of a faster solution maybe with regexp's?
First off - your input doesn't match your output. Secondly:
$string = "TOYOTA Corolla 1985 auto sedan 12 mths REGO good cond \$3800
Call Phil (02) 6558 2679";
$string =~ /(.+)(\b\S+\s\b\S+\s\b\S+\sREGO\s\b\S+\s\b\S+\s\S+\s)(.+)/;
print "$1\n";
print "$2\n";
print "$3\n";
That works, but I haven't tested the speed.
--
John Moreno
------------------------------
Date: Sat, 26 Sep 1998 14:48:34 -0400
From: Michel Prevost <michel.prevost@cactuscom.ca_REMOVE_TO_MAIL>
To: Patrick Collins <pcollins@web.fairfax.com.au>
Subject: Re: CHALLENGE: Fastest algo wins.
Message-Id: <360D3702.E08AD37A@cactuscom.ca_REMOVE_TO_MAIL>
Hi Pat
I have found the solution, it is a one-liner, doesn't use any function. The
fact is that I won't give it to you because the purpose of this group is not
to make people do your homework for you. Hint: Study regular expressions.
Michel
Patrick Collins wrote:
> Hi all,
>
> A simple little string manipulating brainteaser for y'all. Well, I
> thought it was simple, but ended up messing around for ages.
>
> ---
> I have a string which contains a word, called "REGO". Possibly more than
> once. I'd like to break the string up around the word including 3 words
> either side. So the string gets broken into three separate strings. That
> means then that the middle string will always be seven words.
>
> Example:
>
> $string = "TOYOTA Corolla 1985 auto sedan 12 mths REGO good cond $3800
> Call Phil (02) 6558 2679"
>
> ($beginning,$middle,$end) = &black_box( $string );
>
> The values become:
> $beginning: "TOYOTA Corolla 1985 auto ";
> $middle : "sedan 12 mths REGO good cond $3800 ";
> $end : "[PLATE] Ph (02) 6558 2679";
>
> I have a working solution using split and messing around with array
> positions and grep and... well... it was yuk. It is too slow. Can anyone
> think of a faster solution maybe with regexp's?
>
> Thanks in advance.
> Patrick Collins.
------------------------------
Date: Sat, 26 Sep 1998 15:08:54 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: CHALLENGE: Fastest algo wins.
Message-Id: <360D3BC6.D6A9C9F8@negia.net>
Patrick Collins wrote:
>
> Hi all,
[snip]
>
> ---
> I have a string which contains a word, called "REGO". Possibly more than
> once. I'd like to break the string up around the word including 3 words
> either side. So the string gets broken into three separate strings. That
> means then that the middle string will always be seven words.
>
> $string = "TOYOTA Corolla 1985 auto sedan 12 mths REGO good cond $3800
> Call Phil (02) 6558 2679"
>
> The values become:
> $beginning: "TOYOTA Corolla 1985 auto ";
> $middle : "sedan 12 mths REGO good cond $3800 ";
> $end : "[PLATE] Ph (02) 6558 2679";
[snip]
hmm, well my version uses "split" and the fact that it returns captured
separators. also, i assume that anytime we see REGO it must be followed
by at least 4 "words" (if not, the fix is trivial). and finally, your
definition of a "word" may differ from what i have below, which is
sufficient for the sample provided:
print join "-\n", &break($string);
sub break {
split /((?:\S+ ){3}REGO (?:\S+ ){3})/, shift;
}
not sure if this is the fastest, since i have nothing to compare
against, but it should be pretty quick.
cheers,
--
Dan Boorstein home: danboo@negia.net work: danboo@y-dna.com
"THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
- Cosmic AC
------------------------------
Date: Sat, 26 Sep 1998 15:24:22 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: CHALLENGE: Fastest algo wins.
Message-Id: <360D3F66.64A8604A@negia.net>
Dan Boorstein wrote:
>
[SNIP]
>
> print join "-\n", &break($string);
>
> sub break {
> split /((?:\S+ ){3}REGO (?:\S+ ){3})/, shift;
> }
>
> not sure if this is the fastest, since i have nothing to compare
> against, but it should be pretty quick.
>
after a quick benchmark i see that the expanded form is a bit faster
(about 27% here). and since that seemed to be the main concern:
sub break {
split /(\S+ \S+ \S+ REGO \S+ \S+ \S+ )/, shift;
}
i actually find it easier to read too, so that's another bonus.
cheers,
--
Dan Boorstein home: danboo@negia.net work: danboo@y-dna.com
"THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
- Cosmic AC
------------------------------
Date: Sat, 26 Sep 1998 10:00:58 -0700
From: "Phinneas G. Stone" <phinneas@eskimo.com>
Subject: Help w/ S.Sol's DB_Manager/Search
Message-Id: <360D1DCA.94012221@eskimo.com>
I can get it to run at the command line, but not through the browser (it
just hangs). Yes I know about permissions and have triple-checked them.
Shouldn't matter anyway since I'm testing first on a Win95 machine. Yes
other perl cgi programs work fine on this localhost, so it's not a
problem there. I even hard-coded the setup file variable since it
wouldn't accept it from the form, and that got it to at least work from
the command line. I'm really pulling my hair out over this and would
appreciate any help. Please reply by email since I don't frequent this
group as often as I should.
Thanks,
Phinneas
------------------------------
Date: Sat, 26 Sep 1998 21:05:35 -0700
From: Arvo Huru <ah@barentsnett.no>
Subject: How to log click-thru's for URL's
Message-Id: <360DB98F.589CB2ED@barentsnett.no>
How do I do the folowing :
log how many times a link on my site referring to an outside page has
been clicked in an database...
The method I think i have to use is the one that each link is prosessed
thru an cgi.
Lats say the link will be looking like this :
..../cgi-bin/track.cgi?http://www.site.com/page/
I'll be greatfull for any help I can get.
--
- Arvo Huru
ah@barentsnett.no
------------------------------
Date: 25 Sep 1998 18:09:21 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How to test if a value is a number or a string
Message-Id: <6ugm8h$i90$1@marina.cinenet.net>
Sean McAfee (mcafee@waits.facilities.med.umich.edu) wrote:
: > /^\d{5}(?:-\d{4})$/
:
: ITYM /^\d{5}(?:-\d{4})?$/
And right you are...darn finger must've slipped. Thanks for the catch!
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: 26 Sep 1998 18:56:15 GMT
From: "JD Lampard" <lampard@ticnet.com>
Subject: Re: Internal Server Error (Premature end of script headers)
Message-Id: <D4510F6FD9AB3552.A031836BBBBBB4DF.E232DCF028C94ED5@library-proxy.airnews.net>
Sorry folks--I didn't get the semicolong when i copied the code. So, yes,
it was/is there, and it still doesn't work.
-JD
JD Lampard <lampard@ticnet.com> wrote in article
<98EAA94897203E01.377606EE6CA09818.BC8ED5F2EA6964C7@library-proxy.airnews.ne
t>...
> When my script executes, or attempts to I am returned the following
error:
>
> Internal Server Error
> Premature end of script headers
>
> Important Info:
> -My Perl skills are limited--although growing.
> -My script worked previously, but the output to the browser wasn't very
> pleasing, so I wanted to do some editing.
> -I got the error mentioned above afterwards. So, I tried to "undo" my
> editing. No luck!
> -So, I deleted what I thought to be the problem area. Still no luck!
> -I did some more deleting; I got no promising results.
> -I created a new script...
>
> #!/usr/bin/perl
> &PrintHeader
> sub PrintHeader {
> print "Content-type: text/html\n\n";
> print "test";
> }
>
> -Did it work??? Same f@#%ing error!!!
>
> What's the deal?!
>
> PS The script resides on an NT server w/Perl 5.005 (and ActiveWare for
> Win32). I do my editing on an NT box
>
> Thanx a bunch for your help,
> JD
> lampard at ticnet.com
>
------------------------------
Date: Sat, 26 Sep 1998 18:36:53 GMT
From: hampus@globetree.org (Hampus Brynolf)
Subject: M/// problem again...
Message-Id: <360d3408.28344987@192.168.0.1>
Hello!
(Re-sent due to unreadability...)
I have a little problem with m/// (I think)
My routine opens a file, read the content, search for a match, changes
one variable and writes it back
$filen contains the entire file (one line). The content looks like
this:
$star,$starpic,$starpicnr,$description;$star,$starpic,$starpicnr,$description;$star,$starpic,$starpicnr,$description;
ex.
my_star,1,4,this is my star; my_star_two,3,3,this is also my
star;blue_star,3,5,this is a blue star;
Now - what i want to do is the following:
search the string (the file) for the correct $star, read the
$starpicnr, increase the number with 1 and then write it back.
$filen=~m/$star,$starpic,(.*),(.*);/;
$starpicnr=$1;
$starpicnr++;
$filen=~s/$star,$starpic,.*,.*;/$star,$starpic,$starpicnr,$description;/;
Ok. Now - the problem: everything works just fine BUT the
rest of the entries in the file disappear. Let4s say I find a match:
"my_star_two", read the starpic to 3, increase the number, and then
write it all back. Then "blue_star" and all entries after that one
dissappear. It will look like this:
my_star,1,4,this is my star; my_star_two,3,4,this is also my star;
So - how can I just make my change without loosing the rest of the
file? What do I do wrong?
Thanks!
Hampus Brynolf
hampus@globetree.org
------------------------------
Date: Sat, 26 Sep 1998 17:39:52 GMT
From: perl@NOSPAM.httptech.com
Subject: New mailing list for Perl - Win32::GUI users
Message-Id: <3619244e.45604217@news.supernews.com>
Hi all
I've started a new mailing list for Win32 perl developers
who use the Win32::GUI module developed by Aldo Calpini.
To join the list, send a message to majordomo@httptech.com
with the command:
subscribe perl-win32-gui
in the body of the message.
-----------------------------------------
A few things to note about this new list:
1. It's not intended for Perl/TK GUI development discussion. There is a Usenet
group, comp.lang.perl.tk, devoted to Perl/TK discussion if that's your GUI
platform of choice.
2. Right now Win32:GUI's binary distribution only works with the Gurusamy
Sarathy port of perl 5.00402 which is available at
http://www-personal.umich.edu/~gsar/perl5.00402-bindist04-bc.tar.gz
although I hear an activestate port of Win32::GUI is in the works.
3. If you don't have it already, get Win32::GUI at
http://www.divinf.it/dada/perl/gui/index.html
Thanks!
-Joe Stewart
perl_AT_httptech_DOT_com
------------------------------
Date: Sat, 26 Sep 1998 10:46:30 -0400
From: "caustic" <caustic@causticinteractive.nospam.com>
Subject: newbie Perl Program help
Message-Id: <356ae54e.0@newsprime.tidalwave.net>
Hi,
I have been trying to write a quick CGI that displays news headlines from a
newspage.
Basically, this script needs to hit a flat html page and grab the first 3
headlines it finds within <headline></headline> tags and display them on a
homepage.
Has anybody written anything similar to this that they could share with me?
I've been trying to repurpose a search engine that I have to do this, but
I've been running into a lot of problems.
If you could e.mail any ideas/scripts to me for doing this, I'd really
appreciate it.
Thanks a lot,
keith
keith@causticinteractive.spamsux.com
(just remove the 'spamsux.')
------------------------------
Date: 26 Sep 1998 22:07:13 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: Tony Wenzelhuemer <awenzelh@atpibm6000.tuwien.ac.at>
Subject: Re: pattern match problem
Message-Id: <m3emsy63ke.fsf@joshua.panix.com>
Tony Wenzelhuemer <awenzelh@atpibm6000.tuwien.ac.at> writes:
> --------------EB3BF6EF248D3FFB5D5637D0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
Please check your newsreader settings and turn off the "post using
HTML". Plain text is better for most newsreaders.
> if(($bchk!~/[^0-9]/) || ($bchk=~/[^0-9]/ && $1=~/\./)) {
> I would read that as
> "if $bchk does not contain anything else but 0...9 (i.e.does only
> contain 0...9) or if $bchk does contain anything but 0...9 and this
> anything is a .(dot)then accept $bchk, else shout ERROR."
I have a couple of suggestions for you. One is to learn the various
mnemonic shortcuts for character classes. You may specify a non-digit
with \D, for example. Read perlre.
Also, you may use capturing parens even in a negative match (i.e.,
when using the !~ binding operator), so there's no need for you to
repeat the match. Oh, and $1 will never be defined there, since you
didn't use capturing parens, which is most likely why your code
doesn't work.
You should spend some time learning Perl operator precedence so you
don't have to type so many parentheses! I keep handy a printout of the
first page of perlop.
Finally, since you're checking whether $1 is exactly equal to a
certain character, it's marginally more efficient to use the eq
operator than to run a regex.
if ( $bchk !~ /(\D)/ || $1 eq '.' )
But your code doesn't check for the possibility that there's more than
one non-digit character, etc. What are you actually trying to do? If
you're checking for non-numerical input, then start with the code
given in perlfaq4, "How do I determine whether a scalar is a
number/whole/integer/float?"
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Sat, 26 Sep 1998 15:24:26 -0500
From: Butch Bridges <bridges@brightok.net>
Subject: Perl Newbie
Message-Id: <360D4D79.C9F43DD9@brightok.net>
I know nothing about Perl. Been told we can use it to "convert" out DBF
records here at the courthouse to an HTML format so the records can be
placed on our website for the public to search/access. If we place our
records on the Net, we will be the first courthouse in Oklahoma to do
so. Would anyone be willing to me help achieve this goal? Or maybe
there is another way of making these rocords available on the Net?
Please send me email at bridges@brightok.net if you would like
to be a part of this First.
------------------------------
Date: Sat, 26 Sep 1998 13:45:46 -0400
From: Michel Prevost <michel.prevost@cactuscom.ca_REMOVE_TO_MAIL>
Subject: Perl not terminating
Message-Id: <360D284A.A02071A9@cactuscom.ca_REMOVE_TO_MAIL>
Hi all
Have anyone ever experienced a perl script not terminating and found the
solution?
Tx
Michel
------------------------------
Date: Sat, 26 Sep 1998 18:00:40 GMT
From: "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
Subject: Re: Perl not terminating
Message-Id: <cZ9P1.9$cR3.376256@burlma1-snr1.gtei.net>
Michel Prevost wrote
>Have anyone ever experienced a perl script not terminating and found the
>solution?
On UNIX we use 'kill -9', 'init 0' works too. :)
e.
------------------------------
Date: Sat, 26 Sep 1998 14:52:55 -0400
From: Michel Prevost <michel.prevost@cactuscom.ca_REMOVE_TO_MAIL>
To: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Perl not terminating
Message-Id: <360D3807.1F1060BB@cactuscom.ca_REMOVE_TO_MAIL>
That is what we do to make it stop. But i want the script to terminate by
itself. For a reason I don't know, the script won't terminate after the
exit() call.
The script have perfectly performed its job, but it don't exit.
Michel
Elaine -HappyFunBall- Ashton wrote:
> Michel Prevost wrote
>
> >Have anyone ever experienced a perl script not terminating and found the
> >solution?
>
> On UNIX we use 'kill -9', 'init 0' works too. :)
>
> e.
------------------------------
Date: 26 Sep 1998 20:14:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl not terminating
Message-Id: <6ujhud$kfu$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Michel Prevost
<michel.prevost@cactuscom.ca_REMOVE_TO_MAIL>],
who wrote in article <360D3807.1F1060BB@cactuscom.ca_REMOVE_TO_MAIL>:
> That is what we do to make it stop. But i want the script to terminate by
> itself. For a reason I don't know, the script won't terminate after the
> exit() call.
>
> The script have perfectly performed its job, but it don't exit.
How do you know it called exit()? Did you try to trace/truce (sp?)
it? Hmm, maybe Perl is close()ing some unclosed pipe, thus wait()ing
for the kid (instead of you doing this explicitly)? I do not know
whether Perl will do it...
Ilya
------------------------------
Date: Sat, 26 Sep 1998 17:29:37 GMT
From: "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
Subject: Re: perl tutorial
Message-Id: <5w9P1.7$cR3.363050@burlma1-snr1.gtei.net>
chaitra@my-dejanews.com wrote in message
<6uhvg8$sp3$1@nnrp1.dejanews.com>...
>can anyone help me in finding some good perl tutorial on the web.
http://www.perl.com would be a really great place to start.
e.
------------------------------
Date: Sat, 26 Sep 1998 17:53:54 GMT
From: markolopa@my-dejanews.com
Subject: please help with my first perl script
Message-Id: <6uj9nh$9ru$1@nnrp1.dejanews.com>
Hi,
I simply want to read a web page. I tried the tcp client from the book (page
349) and it worked fine. I just changed it adding a
print(SOCK,"GET \/\n\n");
but I don't get the page, the script hangs after connecting (after printing
"Connected!"). I am using perl 5.004 and linux.
#!/usr/bin/perl
use strict;
use Socket;
my ($remote,$port,$iaddr,$paddr,$proto,$line);
$remote = "www.ucl.ac.be";
$port = 80;
$iaddr = inet_aton($remote) or die "no host: $remote";
$paddr = sockaddr_in($port,$iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
connect(SOCK, $paddr) or die "connect: $!";
print "Connected!=\n";
print SOCK "GET \/\n\n"; #line added!
while ($line = <SOCK>) {
print "$line";
}
close (SOCK) or die "close: $!";
exit;
Besides the fix I would appreciate hints of how to monitor the usage of
sockets to be able to debug problems like that in future.
Thank you very much,
Marko
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 26 Sep 1998 14:35:28 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: please help with my first perl script
Message-Id: <6ujc5g$fee$1@monet.op.net>
In article <6uj9nh$9ru$1@nnrp1.dejanews.com>,
<markolopa@my-dejanews.com> wrote:
> print(SOCK,"GET \/\n\n");
>
>but I don't get the page, the script hangs after connecting (after printing
>"Connected!")
See
http://www.plover.com/~mjd/perl/FAQs/Buffering.html
Read the whole thing, and pay close attention to the part that begins
``I'm trying to send data over the network, but nothing is sent!''
Also, next time you say something is on page 349 of `the book', please
include the title of `the book'.
------------------------------
Date: 26 Sep 1998 15:38:04 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: POLL: Perl features springing into your face
Message-Id: <6uj1os$4q5$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Tye McQueen
<tye@fumnix.metronet.com>],
who wrote in article <6ugqp3$lim@fumnix.metronet.com>:
> ) That's because you were in an lvalue context, so you autovivified.
> ) As an rvalue, you'd have taken a fatal from strict.
>
> And C<grep> provides an lvalue context even though I'm really
> using it to grep [searching for matches, not changing things]
> so my typo is not caught.
>
> Even if there weren't so many lvalue contexts that are likely to
> be used like rvalue contexts [C<for>, arguments to subroutines,
> etc.], I'd still like the _option_ to have autovivifaction _always_
> fail so I can catch my typos. Catching typos only when I remember
> to artificially induce rvalue contexts isn't really a big help.
>
> Anyone agree or disagree? Yes, I know I can always submit a patch,
> but I'd like to get a feel for how it might be received before I go
> try to write it.
I think it is a very important proposal. I would like to counter it
with a different idea of mine:
use no_surprises;
use dull;
use pythonish;
use less 'magic';
use less 'surprises';
(do not know a good name). We should collect the list of "Historical"
features of Perl, which were created to simplify some obscure
one-liners, but now make serious programming with Perl almost
impossible. (I would switch to Python a couple of years ago already,
if not whitespace madness.)
The big problem is to accumulate the list of these feature, since the
default list of them should be very useful, and there will be no
possibility to add/remove new members. I have several candidates
already, some of them may deserve a separate pragma, some should be
switchable off in one scoop, since the usability is questionable.
a) IO syntax ??? (probably separate) "give $dog bone"
b) Implicit arguments ??? (probably separate)
c) difference in scope of my and local, of if and when
???
d) /$var/ with empty $var
e) ?foo?
f) m?? ??? Is it getting in the way?
g) split not splitting at the boundary
??? One will need to rewrite split // as
split /(?!\A|\z)/
h) "If it looks like a function..." with print ($a + $b), $c, $d
g) All heuristics with calculating weights etc to find what
/$var[1-2]/ means (and other heuristical algorithms)
i) magic open ??? Almost missed this one, apparently
it is a dear child to Tom, and is
hated by most others.
There should be much more! I hoped that Tom and Random keep a list of
their peeves obtained when teaching, but apparently these misfeatures
bite experienced people only: beginner just do not use things which
are complicated enough, or do not recognize that something is not
their fault (or even do not recognize that it does not do what they
wanted...).
Hope to hear from you to get an authoritative list.
Ilya
------------------------------
Date: Sat, 26 Sep 1998 09:48:31 -0700
From: chuck <criggs@powernet.net>
Subject: Search Engine Woes
Message-Id: <360D1ADF.A0E79AD3@powernet.net>
passme
Hi:
I run a small missing person site and looking for a search engine
for the site. I have one now that works 'OK', but I would like to make
it more 'user friendly'.
I was hoping someone would know of a search engine that can handle a
similar html code like the following. HTML code would have 4-5 options
and a small 'open word search'.
Thanks,
Chuck at Reno
<html>
<p>Missing Person Information:<BR><BR>
<B><FONT FACE="arial">Gender:</FONT></B>
<BR><SELECT NAME="Sex">
<OPTION VALUE="Male">Male
<OPTION 1`1`1VALUE="Female">Female
</SELECT>
<B><FONT FACE="arial">Natural Hair & Eye Color.</FONT></B>
<BR><SELECT NAME="Hair">
<OPTION VALUE="Blonde">Blonde.
<OPTION VALUE="Black">Black.
<OPTION Value="Brown">Brown.
<OPTION VALUE="Gray">Gray.
<OPTION Value="Red">Red.
<OPTION VALUE="None">None.
</SELECT>
<SELECT NAME="EyeColor">
<OPTION VALUE="Blue">Blue.
<OPTION VALUE="Black">Black.
<OPTION Value="Brown">Brown.
<OPTION VALUE="Hazel">Hazel.
<OPTION Value="Green">Green.
<OPTION VALUE="Not Known">Not Known.
</SELECT><BR>
<B><FONT FACE="arial">Heritage - Race</FONT></B>
<BR><SELECT NAME="Race">
<OPTION VALUE="Other">Other
<OPTION VALUE="White">White
<OPTION Value="Black">Black
<OPTION VALUE="Oriental">Oriental
<OPTION VALUE="Hispanic">Hispanic
<OPTION VALUE="Amer. Indian">Amer. Indian
<OPTION VALUE="East Indian">East Indian
</SELECT><BR>
<th>Text to Search For: </th><th><input type=text name="terms" size=20>
<br></th>
</body>
</html>
------------------------------
Date: Sat, 26 Sep 1998 17:50:39 GMT
From: "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
Subject: Re: Shell for testing Perl/CGI scripts!?
Message-Id: <PP9P1.8$cR3.371622@burlma1-snr1.gtei.net>
Michael Yevdokimov wrote
>Does anyone know any software for testing being written Perl/CGI scripts
>(shell or any more and where to download)?
You mean like the debugger Perl -d?
e.
------------------------------
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 3832
**************************************