[8542] in Perl-Users-Digest
Perl-Users Digest, Issue: 2159 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 22 19:07:23 1998
Date: Sun, 22 Mar 98 16:00:36 -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 Sun, 22 Mar 1998 Volume: 8 Number: 2159
Today's topics:
Re: - Looking for a Linkchecker script - (brian d foy)
Re: A siomple question of asthetics. (Andrew M. Langmead)
Re: An offer to buy a script (brian d foy)
Re: Can't understand /g (match global) operator - help! <merlyn@stonehenge.com>
Re: Challenge your programming skill (TomH)
Re: client/server socket deadlock (Andrew M. Langmead)
Re: Die won't die! pleez help (brian d foy)
Re: help needed with grep type function for perl script (Martin Vorlaender)
Re: how to know the version of the perl (Martin Vorlaender)
Re: inplace search and replace (Andrew M. Langmead)
Re: Is there a "Newsgroup" for Newbies to Perl? (Kai Henningsen)
Re: Is there a "Newsgroup" for Newbies to Perl? (Kai Henningsen)
Re: Is there a "Newsgroup" for Newbies to Perl? <merlyn@stonehenge.com>
Re: multi-line matching problem <uri@sysarch.com>
Re: Perl + Tk? (Jim Weisgram)
Re: Perl Magazines <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: Perl Magazines <uri@sysarch.com>
Re: PerlRing??? <merlyn@stonehenge.com>
Sockets and FileHandles <ctrotto@trotto.com>
Re: Wanted: Perl for Windows 3.x <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: what is wrong with being a novice ?? (Kai Henningsen)
Re: what is wrong with being a novice ?? (Kai Henningsen)
Re: Wierd redirection problem with Location: <flavell@mail.cern.ch>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 22 Mar 1998 18:51:40 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: - Looking for a Linkchecker script -
Message-Id: <comdog-2203981851400001@news.panix.com>
Keywords: just another new york perl hacker
In article <6f0q5h$st6@newsops.execpc.com>, Mark Stackhouse <stackhou@execpc.com> posted:
> You may want to wander around in the Perlring for awhile.
> Loads of good stuff in there (most of it's free). If your
> interested, the URL is:
perhaps you should put [Gratuitous Advertisement] at the top
of such posts.
for link checkers, see the documentation in the LWP family of
modules. you might you check out Randal's WebTechnique articles [1].
there is at least one devoted to this issue.
good luck :)
[1]
<URL:http://www.stonehenge.com/merlyn/WebTechniques/>
--
brian d foy <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Sun, 22 Mar 1998 21:18:37 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: A siomple question of asthetics.
Message-Id: <Eq8oJ2.8s3@world.std.com>
"Russ White" <russwyte@pcisys.net> writes:
>I have an array of string scalars that will be printed to a file. They are
>coming from an unformated file with no line breaks at all. I would like to
>use a short piece of code to insert line breaks on whitespace between words
>when a lines length gets to be about 60 character.
Take a look at the Text::Wrap module that comes with the standard perl
distribution.
use Text::Wrap qw(wrap $columns);
$columns = 60;
$wrapped = wrap('', '', @text)
--
Andrew Langmead
------------------------------
Date: Sun, 22 Mar 1998 18:41:30 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: An offer to buy a script
Message-Id: <comdog-2203981841300001@news.panix.com>
Keywords: just another new york perl hacker
In article <3514c83d.24124763@news.aloha.net>, dodge@aloha.net posted:
> I need a script that runs on a unix server that will function in the
> major browsers (ver. 3.xx of Netscape and MS IE) that will reflect the
> address, date and time of a visitor to my site. This utility to be
> placed on several pages to inform the visitor that the visit is
> logged.
most servers already log this information for you. you don't need a
script - just grep for the subset of log entries that you want.
for the stuff printing to a page, you could use a couple of nifty
server side includes.
but then, if you really want to pay for something, just send along a
check... :)
--
brian d foy <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: 22 Mar 1998 16:31:31 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Can't understand /g (match global) operator - help!
Message-Id: <8cn2eiqp4c.fsf@gadget.cscaper.com>
>>>>> "Bart" == Bart Lateur <bart.mediamind@tornado.be> writes:
Bart> If you want that, simply drop the star:
Bart> @matches = /([a,b,c])/g;
Bart> will fill @matches with ('a','b','c'). Just as you'd like it to be.
Uh, and commas. I think you want [abc], not [a,b,c].
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 162 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@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Sun, 22 Mar 1998 22:00:28 GMT
From: beans@bedford.net (TomH)
Subject: Re: Challenge your programming skill
Message-Id: <35156963.5573870@news.bedford.net>
What you say is true, but his original problem was how to find the
list of customers "near" the query point without having to check every
customer in his database. The box was suggested as a first (coarse)
filter to cut down the number of customers to consider while ensuring
none were missed. You're also right that (with the refinement I note
in the third paragraph here) he probably should go ahead and check
every customer that survives the first filtering. Data that is very
clumpy (lots of customers crawling around in large cities) might
require some refinements in selecting the box dimensions, but that's
easy (and besides, even New York City only represents a few percent of
the total US population).
I haven't seen a better way to select candidates suggested. Another
alternative I considered was to maintain a "closest zipcode with at
least one customer" for every Zipcode. That might not be so bad if the
maintenance is less costly than the queries, but it is very
non-extensible. An advantage of the coarse filtering approach is that
you can select a customer based on several dynamic criteria. We
calculated a "score" that depended on distance, value, chance of
success, time since last selected, etc.; the goal was not to minimize
query time but rather to consider as many customers as possible within
the permitted wall time. I've seen other customer selection projects
with similar specifications.
Actually, a more significant problem is that you shouldn't consider
every customer that is found in the box when distance is the only
factor, since a customer due east, west, north, or south that is just
outside the box might be closer than one just inside a corner. To
handle it correctly you need to calculate the distance to the closest
boundary line and only pick a customer within that radius. Using the
dot product makes it easy, although the hypotenuse is close enough for
short distances. I doubt he wanted to calculate the great circle's arc
length between two zipcodes.
On 22 Mar 1998 01:55:30 GMT, abigail@fnx.com (Abigail) wrote:
...
>That results to an Omega (N log N) algorithm worst case. The basic problem
>with your approach is that if the first selection returns "too many
>customers" (that is, a linear number of customers) you might as well
>have compared the distance of all customers with your query point.
...
------------------------------
Date: Sun, 22 Mar 1998 21:07:19 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: client/server socket deadlock
Message-Id: <Eq8o08.4wp@world.std.com>
Dan Hurley <dan.hurley@worldnet.att.net> writes:
>Server has no trouble receiving client message but client & server seem
>to hang if the server tries to respond back to the client on the same
>socket after receiving the client message.
Set the buffering on the socket to "commmand buffering" so that the
writes happen at the end of each "print" statement. The reason that
you are seeing the text on the screen, but on from the socket, is that
terminal default to "line buffering" while non-terminals do not.
$new_sock->autoflush(1);
--
Andrew Langmead
------------------------------
Date: Sun, 22 Mar 1998 18:58:39 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Die won't die! pleez help
Message-Id: <comdog-2203981858390001@news.panix.com>
Keywords: just another new york perl hacker
In article <6f3jvj$fjv$1@viper.america.net>, "Mark Polakow" <mark@imp.net> posted:
> One thing, my "die" isn't dying and I don't know why? as in
> this statement:
>
> mkdir "$root/$dir/$xfile", 0777
> or die "Unable to create $xfile in $dir, $!";
um, maybe the mkdir succeeded?
> I am using Perl on NT I don't know if this makes a difference or not?
well, try a script like:
#!/usr/bin/perl
die "i died\n";
print "i didn't die\n";
__END__
if it doesn't die then you have a problem with die. otherwise, the
problem is somewhere else.
--
brian d foy <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: Sat, 21 Mar 1998 09:44:03 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: help needed with grep type function for perl script.
Message-Id: <35137dd3.524144494f47414741@radiogaga.harz.de>
Benjamin Holzman (bholzman@mail.earthlink.net) wrote:
: Well, of course, you _could_ use grep. Or, this:
: open(FILE, "<filename") or die "Couldn't open filename: $!";
: my $found_it = 0;
: my $ip_to_find = '128.0.0.2';
: while (<FILE>) {
: if (/$ip_to_find/) {
: print;
: $found_it = 1;
: last;
: }
: }
: print "Couldn't find [$ip_to_find]." unless $found_it;
or better yet, use /\Q$ip_to_find\E/, so '128a0b0c2' won't be matched.
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Sat, 21 Mar 1998 09:50:58 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: how to know the version of the perl
Message-Id: <35137f72.524144494f47414741@radiogaga.harz.de>
lihong@public1.guangzhou.gd.cn wrote:
: How can I know the version of perl running on my workstation?
: the first line of perl scirpt should be /usr/local/bin/perl.
% /usr/local/bin/perl -V
will tell you the version (and a lot of other things you never wanted to
know).
Look into perlrun.pod to find this information.
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Sun, 22 Mar 1998 21:15:18 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: inplace search and replace
Message-Id: <Eq8oDL.7nJ@world.std.com>
kucera@mindsrping.com ( Mark Kucera) writes:
>we want to walk through the master file, line by line, and see if it
>is in the test file (we can do this ) if it is in the test file we
>want to be able to flag that entry in the master file in its location
>(by adding a * to one of the fileds.) we want to update in place, we
>DON't want to rewrite the file each time this case occurs. isnt there
>some sort of search replace feature in perl??
Have you seen the FAQ entry: "How do I change one line in a
file/delete a line in a file/insert a line in the middle of a
file/append to the beginning of a file?"
<URL:http://www.perl.com/CPAN-local//doc/manual/html/pod/perlfaq5/
How_do_I_change_one_line_in_a_fi.html>
If it is too expensive to rewrite the entire text file each time, then
maybe you should be using something other than the text file format.
Also you imply that there should be a way because other programs have
"search and replace" features. Do you think that it is possible that
these other programs rewrite the file each time?
--
Andrew Langmead
------------------------------
Date: 22 Mar 1998 22:29:00 +0200
From: kaih=6qLXH67mw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6qLXH67mw-B@khms.westfalen.de>
cberry@cinenet.net (Craig Berry) wrote on 13.03.98 in <6ec98q$q4e$1@marina.cinenet.net>:
> No, programming is not an easy thing;
> I think part of the problem is that people *expect* it to be easy, expect
> to be able to approach it as one would a (say) Windows word processor --
> playing with it to learn, rather than reading a single word of the doc
> (on- or offline). This simply will not work, and those who expect it to
> need an awakening, rude or otherwise.
I can't resist pointing out that actually, this works pretty well for me
as long as I do it with programming languages, and not with Windows word
processors, whose finer points I certainly don't grok :-)
Seriously, playing with a programming language to learn strikes me as one
of the best possible ways to learn it. Of course, depending on what you
already know, this *takes time*. But nothing ever beats hands-on
experience.
Now, that doesn't mean it's easy. But while we are talking about playing,
when was the last time you played a game worth playing that was *easy*?
In general, a programming language can be "easy" if it's a good match to
the problem you're trying to solve, and you understand the type of
programming typical for that language. Otherwise, it's hard.
Doing pattern matches in Perl is easy, once you understand pattern
matching in general.
Doing it in FORTRAN is hard.
Doing fast number crunching in Perl is hard.
Doing it in FORTRAN is easy, if you understand number crunching in
general.
Of course, if you don't understand programming at all, everything's going
to be hard no matter what. No surprise there, if you ever cared to think
about it.
Kai
--
Internet: kai@khms.westfalen.de
Bang: major_backbone!khms.westfalen.de!kai
http://www.westfalen.de/private/khms/
------------------------------
Date: 22 Mar 1998 22:47:00 +0200
From: kaih=6qLXHNEmw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6qLXHNEmw-B@khms.westfalen.de>
harrison@pixi.com (Robert F. Harrison) wrote on 17.03.98 in <slrn6gt6il.jc0.harrison@localhost.localdomain>:
> On 17 Mar 98 10:47:14 GMT, Robert F. Harrison <harrison@pixi.com> wrote:
> >
> > How dare he give something away free, with instructions, not to
> > mention coercing many people into aiding and abetting without
> > rendering it harmless first.
>
>
> I apologize to all for this message. It was meant in jest but sadly
> failed on all counts.
I'd boggle on that, except I know there are far too many people around
Usenet that wouldn't know sarcasm if it bit them in the ass.
*I* was ROTFL.
> To those who might have taken this not seriously, it was not, should
> not and cannot be interpreted as such. I did neglect to include a
> smiley to indicate jest and have paid the price for my ommission.
The one thing I don't understand - if someone is dumb enough not to
recognize humour that's as blatant as that, why would that someone be able
to understand a smiley?
> Again, please ignore my sad attempt at humor. I sincerely apologize
> to all who have been offended and promise it will not happen again.
The only thing that offends me is the "will not happen again" part. I want
more!
Kai
--
Internet: kai@khms.westfalen.de
Bang: major_backbone!khms.westfalen.de!kai
http://www.westfalen.de/private/khms/
------------------------------
Date: 22 Mar 1998 16:38:52 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <8ciup6qos3.fsf@gadget.cscaper.com>
>>>>> "I" == I R A Aggie <fl_aggie@thepentagon.com> writes:
I> + The dike has broken. The inrush of Newbies is only just
I> + beginning. This Usenet is going to be flooded with "How do
I> + I set up an array in Perl?" at an ever increasing rate
I> + (maybe exponentially). If folks around here don't like
I> + that, you can start flaming Corporate America.
I> No, we'll just create a moderated newsgroup, where such questions
I> will be refered to the documentation. And I doubt I'll read the
I> clp.misc newsgroup after a moderated newsgroup comes on-line.
Seconded.
And this will accelerate comp.lang.perl.misc into the ghetto it has
nearly nearly already become. It'll just be the clueless leading
the blind. :-)
My bet: nearly every question will be about configuring Selena Sol and
Matt Wright's scripts and error 500 on web servers. And a bunch of
responses will all be along the order of "cargo cult programming",
like "/o on a regex speeds it up", "use cgi-lib.pl", "you have to
convert + to space!" and a bunch of other clueless responses and HTML
and MIME-formatted postings. I'll give the group 3 months.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 162 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@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 22 Mar 1998 17:01:49 -0500
From: Uri Guttman <uri@sysarch.com>
To: "Jon Marshall" <xkn14@dial.pipex.com>
Subject: Re: multi-line matching problem
Message-Id: <x7g1kagzaq.fsf@sysarch.com>
"Jon Marshall" <xkn14@dial.pipex.com> writes:
> $/ = '';
here is the problem. you selected paragraph input mode without having
multiple paragraphs in the input
> file - ifcn
> hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
> inet 1.0.1.110 netmask ff000000 broadcast 1.255.255.255
> ether 8:0:20:80:47:ef
insert a blank line here to make a paragraph. see camel (blue)
p. 132. paragraph are delimited by a blank line. you are reading all 4
ifconfigs in one line and matching on the last one only.
> hme1: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
> inet 10.71.1.110 netmask ffff0000 broadcast 10.71.255.255
> ether 8:0:20:0:0:1
blank line
> hme2: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
> inet 10.72.1.110 netmask ffff0000 broadcast 10.72.255.255
> ether 8:0:20:0:0:2
blank line
> hme3: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
> inet 10.73.1.110 netmask ffff0000 broadcast 10.73.255.255
> ether 8:0:20:0:0:3
blank line
> hme4: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
> inet 10.74.1.110 netmask ffff0000 broadcast 10.74.255.255
> ether 8:0:20:0:0:4
hth,
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---- 8 Years of Perl Experience, Available Immediately
uri@sysarch.com --------- Resume and Perl Example at http://www.sysarch.com
Use the Best Search Engine on the Net -------- http://www.northernlight.com
------------------------------
Date: Sun, 22 Mar 1998 23:05:31 GMT
From: jweisgram@hotmail.com (Jim Weisgram)
Subject: Re: Perl + Tk?
Message-Id: <351898bb.81843369@news.teleport.com>
kenk@primenet.com (Ken Knecht) wrote:
>Could someone point me to information about using Tk in Perl, or vice-versa,
>as mentioned in another thread here? None of my Perl books mention Tk in the
>index, and my Tk-Tcl book doesn't mention Perl.
>
>TIA.
>
>Ken
If you visit www.perl.com and then select GUI I think you will find some info.
Which I did and found this:
http://w4.lns.cornell.edu/~pvhp/ptk/ptkTOC.html
And I believe some book titles are mentioned that at least discuss Perl and Tk.
--
All opinions expressed are mine and not my employers (but they ought to be)
Jim Weisgram
Oregon Department of Transportation
------------------------------
Date: Sun, 22 Mar 1998 13:26:50 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Perl Magazines
Message-Id: <6f3vj2$jr3@bgtnsc03.worldnet.att.net>
Check out The Perl Journal
http://www.tpj.com
j5rson@iversonsoftware.com wrote in message
<6f3sjv$v65$1@nnrp1.dejanews.com>...
>I'm looking for magazines, journals, ezines which cover Perl programming
and
>development. I'd like to add them to my online database.
>
> The Directory of Computer Consultants and Developers
> http://www.iversonsoftware.com/cgi-bin/randombanner.cgi
> 21 Devonshire Pl., Mankato MN 56001-4984
> 507-386-6208 - j5rson@iversonsoftware.com
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 22 Mar 1998 17:04:31 -0500
From: Uri Guttman <uri@sysarch.com>
To: j5rson@iversonsoftware.com
Subject: Re: Perl Magazines
Message-Id: <x7d8fegz68.fsf@sysarch.com>
j5rson@iversonsoftware.com writes:
> I'm looking for magazines, journals, ezines which cover Perl programming and
> development. I'd like to add them to my online database.
>
> The Directory of Computer Consultants and Developers
> http://www.iversonsoftware.com/cgi-bin/randombanner.cgi
> 21 Devonshire Pl., Mankato MN 56001-4984
> 507-386-6208 - j5rson@iversonsoftware.com
the perl journal (http://orwant.www.media.mit.edu/the_perl_journal)
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---- 8 Years of Perl Experience, Available Immediately
uri@sysarch.com --------- Resume and Perl Example at http://www.sysarch.com
Use the Best Search Engine on the Net -------- http://www.northernlight.com
------------------------------
Date: 22 Mar 1998 16:30:08 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: joergen.lang@schwaben.de (Joergen W. Lang)
Subject: Re: PerlRing???
Message-Id: <8cra3uqp6n.fsf@gadget.cscaper.com>
>>>>> "Joergen" == Joergen W Lang <joergen.lang@schwaben.de> writes:
Joergen> I was only wondering if it was a good idea to have a
Joergen> standardized format of the docs coming with every
Joergen> distribution of perl, which could be accessed in the same
Joergen> manner on every machine.
Not possible.
Joergen> At the moment UNIXers go "perldoc", Mac users have Shuck and
Joergen> BBedit, I don't know what DOS/Win users have to do...
Joergen> Why not making a HTML or PDF Version of the docs part of the
Joergen> distribution.
I've used many a unix machine that wouldn't have the slightest idea
what "HTML" or "PDF" means.
Joergen> If people who have first time contact with their
Joergen> distribution of Perl and find the docs in a format, they're familiar
Joergen> with they might even make an effort to have a look at it.
Right. "perldoc" seems to be working nearly everywhere now that has a
command line. So, we're there.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 162 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@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Sun, 22 Mar 1998 16:37:06 -0600
From: "carl m. trotto jr." <ctrotto@trotto.com>
Subject: Sockets and FileHandles
Message-Id: <35159292.373A3AA3@trotto.com>
--------------86113779A5EB2453AF7C3C44
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
for($qsfree = $qsrin = '', $i = 0; $i != $MAXSOCKET; $i++ ) {
$qsock[$i] = new IO::Socket;
$qsock[$i]->socket(AF_INET, SOCK_DGRAM, $proto ) || die "socket: $!";
vec($qsrin, fileno($qsock[$i]), 1) = 1;
vec($qsfree, fileno($qsock[$i]), 1) = 1;
select(fileno($qsock[$i])); $| = 1;
}
The about code fragment works, but only for 16 socket FD(s). I tried to
up the
FILES in config.sys but this didn't help.
for($fh = "fh00", $i = 0; $i != $MAXSOCKET; $i++, $fh++ ) {
socket($fh, AF_INET, SOCK_DGRAM, $proto ) || die "socket: $!";
$qsock[$i] = $fh;
select(fileno($fh)); $| = 1;
}
The above code fragment doesn't work.
The way I started to get things moving along was by tracing the URL
package and the "open3" package. Is there a place which explains this
arcane file handle usage? Why does one method work and not the other?
Perl version 5.004_02 Win95 Standard not ActiveWare
Regards,
Carl
--------------86113779A5EB2453AF7C3C44
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
<TT>for($qsfree = $qsrin = '', $i = 0; $i != $MAXSOCKET; $i++ ) {</TT>
<BR><TT> $qsock[$i] = new IO::Socket;</TT>
<BR><TT> $qsock[$i]->socket(AF_INET, SOCK_DGRAM, $proto ) ||
die "socket: $!";</TT><TT></TT>
<P><TT> vec($qsrin, fileno($qsock[$i]), 1) = 1;</TT>
<BR><TT> vec($qsfree, fileno($qsock[$i]), 1) = 1;</TT><TT></TT>
<P><TT> select(fileno($qsock[$i])); $| = 1;</TT>
<BR><TT>}</TT><TT></TT>
<P><TT>The about code fragment works, but only for 16 socket FD(s).
I tried to up the</TT>
<BR><TT>FILES in config.sys but this didn't help.</TT><TT></TT>
<P><TT>for($fh = "fh00", $i = 0; $i != $MAXSOCKET; $i++, $fh++ ) {</TT>
<BR><TT> socket($fh, AF_INET, SOCK_DGRAM, $proto ) || die "socket:
$!";</TT>
<BR><TT> $qsock[$i] = $fh;</TT>
<BR><TT> select(fileno($fh)); $| = 1;</TT>
<BR><TT>}</TT><TT></TT>
<P><TT>The above code fragment doesn't work.</TT><TT></TT>
<P><TT>The way I started to get things moving along was by tracing the
URL package and the "open3" package. Is there a place which explains
this arcane file handle usage? Why does one method work and not the
other?</TT><TT></TT>
<P><TT>Perl version 5.004_02 Win95 Standard not ActiveWare</TT><TT></TT>
<P><TT>Regards,</TT>
<BR><TT>Carl</TT></HTML>
--------------86113779A5EB2453AF7C3C44--
------------------------------
Date: Sun, 22 Mar 1998 13:44:19 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Wanted: Perl for Windows 3.x
Message-Id: <6f40jq$qs7@bgtnsc03.worldnet.att.net>
Steve Palincsar wrote in message <351461FD.25A6@tidalwave.net>...
>Sneex wrote:
>>
>> As a former student, the best I can say is research - AskJeeves &
>> DejaNews :-)
>> (They are a student's BEST first line of information...)
>>
>> To answer your query - see www.activestate.com
>
>NO! The activestate.com site pretty clearly advertises the product
>as being for Win32, not Win16 or DOS.
ActiveState works on Windows 95, where the command line interface is
basically DOS 7. If you can't find the port Abigail was talking about, you
can try it out and see how it'll work, but there are a LOT of features you
can't expect to work (assuming it works at all).
------------------------------
Date: 22 Mar 1998 21:33:00 +0200
From: kaih=6qLXGh-Hw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: what is wrong with being a novice ??
Message-Id: <6qLXGh-Hw-B@khms.westfalen.de>
tim@maroney.org wrote on 21.03.98 in <6f0vp4$e6j$1@nnrp1.dejanews.com>:
> Uh, hello, time is bandwidth. When people refer to their news or mail
> reading bandwidth they are referring to how much information they personally
> have to sort through. This has been a standard idiom on USENET from the
> beginning, or at least since I joined in 1982.
Uh, hello?
I've never seen bandwidth used that way. All uses of "bandwidth" I've ever
seen were about the wire's data capacity, never about people's reading
habits. That's the standard way it's used on Usenet, AFAICT.
Kai
--
Internet: kai@khms.westfalen.de
Bang: major_backbone!khms.westfalen.de!kai
http://www.westfalen.de/private/khms/
------------------------------
Date: 22 Mar 1998 21:43:00 +0200
From: kaih=6qLXGyLXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: what is wrong with being a novice ??
Message-Id: <6qLXGyLXw-B@khms.westfalen.de>
gebis@albrecht.ecn.purdue.edu (Michael J Gebis) wrote on 20.03.98 in <6euvl8$ed2@mozo.cc.purdue.edu>:
> 1) Pull up the FAQ. Use the search feature of your browser to look
> for relevant words.
Browser, browser ... somehow I associate that with the web. What's wrong
with "man perlfaq"?
Or any of the other mans, for that matter.
> 2) Try dejanews.
Maybe. Though so far, I've usually been disappointed trying to find
interesting stuff there. Maybe it's better with Perl that with other
stuff.
> 3) Look it up in the camel's index.
That's about where I *start*, these days. It's also usually where I find
it, maybe with a little bit of experimenting thrown in. Otherwise,
perl -MCPAN -eshell helps a lot.
Of course, there's always the synonym problem when you're searching for
something: what words were actually used to describe what I'm looking for?
> If you've done all three, and can't find what you're looking for,
> mention your search attempts and only then ask the question. You
That's always a good idea, of course.
Kai
--
Internet: kai@khms.westfalen.de
Bang: major_backbone!khms.westfalen.de!kai
http://www.westfalen.de/private/khms/
------------------------------
Date: Sun, 22 Mar 1998 22:26:18 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Wierd redirection problem with Location:
Message-Id: <Pine.A41.3.95a.980322222116.68260A-100000@rsplus09.cern.ch>
On Sun, 22 Mar 1998 tim@maroney.org wrote:
> In article <35070e3f.160314962@news.deltanet.com>,
> fallout@deltanet.com_remove_ (Fallout23) wrote:
> > If you are using PWS or IIS, it is also REQUIRED that you return the
> > status code 301 too. took me a while to figure that one out on my own.
>
> Aha. So that's why my transparent redirects don't do anything,
If you're using those servers, it might be. Why don't you ask on the
appropriate CGI or servers group, describing your problem as far as
you've got? This clearly isn't a Perl language question.
> though I'm using Apache.
Now he tells us. Location: works fine on Apache without an explicit
status 30x, I assure you.
> Is this just the return code from exit, that is, would the perl
> code be simply:
>
> exit 301;
Erm, what was your reaction to the CGI tutorial and spec at
http://hoohoo.ncsa.uiuc.edu?
------------------------------
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 2159
**************************************