[11966] in Perl-Users-Digest
Perl-Users Digest, Issue: 5566 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 5 01:07:25 1999
Date: Tue, 4 May 99 22:00:18 -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 Tue, 4 May 1999 Volume: 8 Number: 5566
Today's topics:
Re: "learning perl" does not seem to be written well <uri@sysarch.com>
Re: "learning perl" does not seem to be written well (Damian Conway)
Re: ==> Dynamic Hash Naming <== (Ronald J Kimball)
Annoyingly simple problem flushing input from a whois s <gavin@optus.net.au>
Another script question - please help ! <andrij@mail.idt.net>
Re: global var disappearing, reappearing <otis@my-dejanews.com>
Re: how do I slurp a file into a string <uri@sysarch.com>
Re: how do I slurp a file into a string (Tad McClellan)
Re: Limit to number of if statements??? (Ronald J Kimball)
Re: Limit to number of if statements??? <uri@sysarch.com>
Re: Limit to number of if statements??? <design@raincloud-studios.com>
Re: Limit to number of if statements??? <uri@sysarch.com>
Re: Limit to number of if statements??? (Tad McClellan)
Re: must be better way (Ronald J Kimball)
Re: must be better way (Larry Rosler)
Re: Newbie having problems getting this script to work. (Bob Trieger)
Re: Perl 5: The Complete Reference, Martin Brown <uri@sysarch.com>
Re: Perl 5: The Complete Reference, Martin Brown (Damian Conway)
Perl and ping <goten@sduteam.com>
Re: perl file "busy"? how can that be? (Sam Holden)
Re: question on regex... <tye@metronet.com>
Script question - please help ! <andrij@mail.idt.net>
Re: startup opportunity: Minnesota (Ronald J Kimball)
Re: Stumped on Regex routine (Ronald J Kimball)
Re: syswrite() lies (Ronald J Kimball)
Re: WebEvent 3.1 BETA released - Web / CGI/ WWW Calenda <design@raincloud-studios.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 04 May 1999 23:39:14 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <x7n1zkyyl9.fsf@home.sysarch.com>
>>>>> "DC" == Damian Conway <damian@cs.monash.edu.au> writes:
DC> Uri Guttman <uri@sysarch.com> writes:
>> my complaint was more about the later part of the relationship with
>> manning. they asked for potential reviewer and i said i might help. they
>> never followed up on that and it annoyed me. i have heard from others
>> about similar behavior from them. so it may not be unsavory (i am
>> allowed some perl poetic license) but not professional nor courteous.
DC> Understood, but that's still no indicator of the likely quality of their
DC> publications. Stallman leaps to mind, yet again.
i am not sure how you are using rms here? i am taking it that you like
his work over his public persona.
DC> To this outside reader at least, it seems like a minor breach of
DC> netiquette which was publicly apologized for as soon as the original
DC> poster's far more net-clueful boss explained the problem to him.
i was probably one of the more annoyed ones. in any case it left a bad
memory attached to the name manning, so i have to be won over by great
books from them.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 5 May 1999 04:14:31 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <7gogj7$h1c$1@towncrier.cc.monash.edu.au>
Uri Guttman <uri@sysarch.com> writes:
> DC> Understood, but that's still no indicator of the likely quality of their
> DC> publications. Stallman leaps to mind, yet again.
>i am not sure how you are using rms here? i am taking it that you like
>his work over his public persona.
His philosopy more than his persona.
The point I was trying to make is that, even though I might find
aspects of *the producer* "unsavory", I am not therefore entitled to
jump to the conclusion that his *product* is crap before I've seen it.
Picasso was pretty "unsavory", but his paintings were wonderful.
Shakespeare was pretty "unsavory", but his prose was superb.
Chaplin was pretty "unsavory", but his comedy was brilliant.
Whether you like or dislike someone--even with good reason!--is no
guide to whether they are likely to produce good work.
It's very *human* to assume the worst of people we dislike,
but it ain't right.
> DC> To this outside reader at least, it seems like a minor breach of
> DC> netiquette which was publicly apologized for as soon as the original
> DC> poster's far more net-clueful boss explained the problem to him.
>i was probably one of the more annoyed ones. in any case it left a bad
>memory attached to the name manning, so i have to be won over by great
>books from them.
For entirely selfish reasons, I sincerely hope you will be ;-)
Damian
------------------------------
Date: Tue, 4 May 1999 23:11:53 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: ==> Dynamic Hash Naming <==
Message-Id: <1draw94.1odnhk2j6d768N@p31.tc2.state.ma.tiac.com>
Andreas Fischer <Andreas.Fischer@germany.Sun.COM> wrote:
> 37 print "3.Index=@{$hostn{$header[0]}} \n";
${$hostn}{$header[0]}
But as Tom explained, you really don't want to use symbolic references.
--
#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
perl -e'for(sort keys%main::){print if $$_ eq 1}
' -s -- -' Just' -' another ' -'Perl ' -'hacker
' http://www.tiac.net/users/chipmunk/ [rjk@linguist.dartmouth.edu]
------------------------------
Date: Wed, 05 May 1999 04:32:51 GMT
From: Gavin Cato <gavin@optus.net.au>
Subject: Annoyingly simple problem flushing input from a whois server
Message-Id: <372FD883.44C7F25C@optus.net.au>
hello all,
I'm having a annoying problem retrieving data from a whois server (whois.radb.net)
I've looked at utils such as autoflush() etc... in the Perl FAQ but can't find a
solution that does the job.
basically I have sent it a command that instructs it to leave the socket open, and
then I want to send it a network entry (e.g. 192.168.100.0), parse the output then
send it another one.
The problem is that after I send the first one there is a whole lot of junk in the
value of $socket that I don't want, and I can't find a way to clear this value WITHOUT
closing the socket first.
The objective of this is to do it without closing the socket (for speed reasons). The
below code is very different from my actual code but I wrote it up as the clearest way
of demonstrating the problem.
I've tried to document the code to show you where it needs to be cleared, I'm just not
exactly sure how to. It is of course trivial if it was ok to close the socket &
re-open it again, but leaving it open is a challenge :-)
Thanks,
#!/usr/bin/perl -w
use IO::Socket;
$socket = IO::Socket::INET->new(PeerAddr => "whois.radb.net",
PeerPort => 43,
Proto => "tcp",
Type => SOCK_STREAM)
or die "Couldn't connect : $@\n";
print $socket "!!\n"; ## This instructs the RADB server to leave
## the socket open after a query
print $socket "203.2.239.0\n";
$tally = "0";
while (<$socket>) {
last if (/^\*so:/); # This signifies the end of the record
print $_;
$tally++;
}
### Need to flush the $socket value to nothing here, without
### closing the socket
print $socket "192.65.88.0";
$tally = "0";
while (<$socket>) {
last if (/^\*so:/); # This signifies the end of the record
print $_;
$tally++;
}
close $socket; # finished with it, close & exit program
------------------------------
Date: Wed, 05 May 1999 00:55:19 +0000
From: andrij <andrij@mail.idt.net>
Subject: Another script question - please help !
Message-Id: <372F96F3.1E892C19@mail.idt.net>
Hello.
Thanks for everyone's help on my last CGI question. I have a second CGI
question I need help with. I have a web-site (let's call it Site 1)
where I need to continually update a second web-site (lets say Site 2)
with info from Site 1 by filling in fields and then hitting a submit
button. I want to try to find a way to automate this process, as I end
up doing this over 5 times a day.
Is there any way to have my web site (Site 1) automatically go onto Site
2, and use
information on Site 1 to fill out a couple of fields, and then have the
information
submitted? Does anyone know how to do it, or can someone point me in
the right
direction? Thanks in advance, and please email me if you can :)
- Christine
------------------------------
Date: Wed, 05 May 1999 02:56:00 GMT
From: Otis Gospodnetic <otis@my-dejanews.com>
Subject: Re: global var disappearing, reappearing
Message-Id: <7gobvv$fuu$1@nnrp1.dejanews.com>
In article <7gnuif$c7l$2@news.NERO.NET>,
Dan Sugalski <sugalskd@netserve.ous.edu> wrote:
> Otis Gospodnetic <otis@my-dejanews.com> wrote:
> [Snip]
> : sub getID
> : {
> : return (shift @ids);
> : }
>
> Bad, Bad programmer! <thwack> No biscuit for you! You're not locking @ids
> before accessing it. (Plus it's global data, which is usually bad
> regardless of how you created it. But that's a separate issue) You must,
> must, *must* use lock() on anything that two threads may access
> simultaneously.
>
> Any time a perl variable may get modified, you must lock() it first,
> before a write *or* a read. (And remember, $a = 1; print $a; modifies $a
> *twice*, once on the assignment and once when perl promotes $a from an
> integer to a string) Otherwise you're just asking for trouble.
>
> Hopefully 5.005_04 and 5.006 will be a little kinder on readers, but as of
> now, it's possible to catch a variable in a half-built state. Perl ops
> are *not* atomic.
Ah, actually I did have this: use attr qw(lock) right there at the beginning
of that subroutine, I just didn't have it in the post. But that doesn't solve
the original 'problem'/weird behaviour...
Otis
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 04 May 1999 23:46:26 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: how do I slurp a file into a string
Message-Id: <x7k8uoyy99.fsf@home.sysarch.com>
>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
>> BTW don't incant that magic code (from abigail) unless you understand
>> each and every part of it.
LR> One (big, to me) problem: How does one intercept death on failure to
LR> open the file? I can't capture it with $SIG{__WARN__} or $SIG{__DIE__};
LR> if I use END the message is printed first, and END has a different
LR> report for $!.
LR> #!/usr/local/bin/perl -w
LR> use strict;
LR> $SIG{__WARN__} = $SIG{__DIE__} = sub { print "in SIG $!\n" };
LR> my $contents = do{ local( @ARGV, $/ ) = 'joblist.asp' ; <> } ;
LR> END { print "in END $!\n" }
go ask abigail, she created it! i have never used it. i use a read_file
sub i wrote and posted a while ago to moderated. in fact i should use
the better version that lets the *FH auto close on leaving scope.
i think it was like this:
sub read_file { # a prototype would be ($)
my( $file_name ) = @_ ;
local( *FH ) ;
# maybe just return but how can you tell a failure from an empty list in
# list context
open( FH, $file_name ) || die "flaming painful death $!" ;
return( <FH> ) if wantarray ;
local( $/ ) ;
return( <FH> ) ;
}
i use this (or my older version) in many scripts as i like to slurp in
files.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Tue, 4 May 1999 18:04:59 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: how do I slurp a file into a string
Message-Id: <buqng7.ij4.ln@magna.metronet.com>
Tim Potter (Tim.Potter@anu.edu.au) wrote:
: tbrannon <brannon@quake.usc.edu> writes:
: > ## HERE: I want to slurp the file into $file_contents in one line of Perl.
^
^
: my @file_contents = <F>;
^
^
That does not do what was asked for.
You have answered some _other_ question there...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 4 May 1999 23:11:54 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Limit to number of if statements???
Message-Id: <1drax0m.13ovqkikfm6wwN@p31.tc2.state.ma.tiac.com>
Larry Rosler <lr@hpl.hp.com> wrote:
> I wonder if
> Perl hackers run in packs (or Monger groups). What is the collective
> noun for such -- a mongeries? (Philologians like TomC will think of
> collections of eels, for example.)
A hash of Perl Mongers.
--
#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
perl -s -e'print sort grep { /\s/ } keys %main::
' -- -is -' Just' -' another ' -'Perl ' -'hacker
' http://www.tiac.net/users/chipmunk/ [rjk@linguist.dartmouth.edu]
------------------------------
Date: 04 May 1999 23:29:34 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Limit to number of if statements???
Message-Id: <x7so9cyz1d.fsf@home.sysarch.com>
>>>>> "CRT" == Charles R Thompson <design@raincloud-studios.com> writes:
>> The problem of one statement is compounded further when a user could
>> click any one of three 'image buttons' on the same form.
>> One thought I had for optimization might be a 'prefix' to button names
>> that wouldn't go through all the items in $query->param, but my second
>> thought is that it's just one more evaluation to slow things down and I
>> was better off where I was.
CRT> Hmm... but if I *did* prefix the buttons with something like btn_ and
CRT> since only one button is returned at a time why am I using the loop in
CRT> the first place?
actually that was another idea i had. just rename the buttons with some
prefix. you can grep out those params from param() which match the
prefix and then dispatch on the only one you should find.
grep being faster and cleaner than a regular loop and youget a two
statement dispatch (not including error handling).
CRT> (okay yeah.. dweebs can type in others buttons as a url.. forget that
CRT> for know)
that is true for all web apps so who cares?
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Wed, 05 May 1999 03:43:16 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Limit to number of if statements???
Message-Id: <o7PX2.1590$iu1.1544@news.rdc1.tn.home.com>
>actually that was another idea i had. just rename the buttons with some
>prefix. you can grep out those params from param() which match the
>prefix and then dispatch on the only one you should find.
>grep being faster and cleaner than a regular loop and youget a two
>statement dispatch (not including error handling).
I'm so glad you didn't show me how. I've been reading a bit to try and
figure it out, so I'll be glad if I get it. I'm stuck on grepping the
param, but I need alot more education in that area anyway. ummm.. Thanks
for nothin.. I mean it! :)
> CRT> (okay yeah.. dweebs can type in others buttons as a url.. forget
that
> CRT> for know)
>that is true for all web apps so who cares?
Yeah... seriously. Sometimes (not too often) I just protect from system
calls and fudge the rest because there is only so much you can do in a
day.
CT
------------------------------
Date: 05 May 1999 00:01:26 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Limit to number of if statements???
Message-Id: <x7emkwyxk9.fsf@home.sysarch.com>
>>>>> "CRT" == Charles R Thompson <design@raincloud-studios.com> writes:
>> actually that was another idea i had. just rename the buttons with some
>> prefix. you can grep out those params from param() which match the
>> prefix and then dispatch on the only one you should find.
>> grep being faster and cleaner than a regular loop and youget a two
>> statement dispatch (not including error handling).
CRT> I'm so glad you didn't show me how. I've been reading a bit to
CRT> try and figure it out, so I'll be glad if I get it. I'm stuck on
CRT> grepping the param, but I need alot more education in that area
CRT> anyway. ummm.. Thanks for nothin.. I mean it! :)
fine. i will never show you any code ever again. i have never before been
thanked in such a poor manner!
:-)
HINT: param() will return all the params and that is input to grep.
the rest is up to you.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Tue, 4 May 1999 18:01:51 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Limit to number of if statements???
Message-Id: <foqng7.ij4.ln@magna.metronet.com>
Larry Rosler (lr@hpl.hp.com) wrote:
: [Posted and a courtesy copy mailed.]
Talking to yourself Larry?
heh, heh
: In article <MPG.11990c0687eea23e9899ba@nntp.hpl.hp.com> on Tue, 4 May
: 1999 14:52:42 -0700, Larry Rosler <lr@hpl.hp.com> says...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 4 May 1999 23:11:55 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: must be better way
Message-Id: <1drax3y.1pgsih01hsbtscN@p31.tc2.state.ma.tiac.com>
Christoph Schmitz <cschmitz@stud.informatik.uni-trier.de> wrote:
> What exactly do you want to accomplish? If you just want
> to strip the trailing spaces, you can use
>
> @new_array = @array;
>
> foreach ( @new_array ) {
> s/\ +$//g;
> }
This would be a great place to use map in a non-void context!
@new_array = map { ($x = $_) =~ s/\ +$// } @array;
The /g is unnecessary, by the way. :)
--
chipmunk (Ronald J Kimball) <rjk@linguist.dartmouth.edu>
perl -e 'print map chop, sort split shift, reverse shift
' 'j_' 'e._jP;_jr/_je=_jk{_jn*_j &_j :_j @_jr}_ja)_js$_j
~_jh]_jt,_jo+_jJ"_jr>_ju#_jt%_jl?_ja^_jc`_jh-_je|' -rjk-
------------------------------
Date: Tue, 4 May 1999 21:42:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: must be better way
Message-Id: <MPG.11996c21fef19f2d9899c5@nntp.hpl.hp.com>
In article <1drax3y.1pgsih01hsbtscN@p31.tc2.state.ma.tiac.com> on Tue, 4
May 1999 23:11:55 -0400, Ronald J Kimball <rjk@linguist.dartmouth.edu>
says...
> Christoph Schmitz <cschmitz@stud.informatik.uni-trier.de> wrote:
> > What exactly do you want to accomplish? If you just want
> > to strip the trailing spaces, you can use
> >
> > @new_array = @array;
> >
> > foreach ( @new_array ) {
> > s/\ +$//g;
> > }
>
> This would be a great place to use map in a non-void context!
>
> @new_array = map { ($x = $_) =~ s/\ +$// } @array;
>
> The /g is unnecessary, by the way. :)
So is the backslash before the space. :)
I doubt that the user wants @new_array to be composed only of ones or
null strings, though. :(
@new_array = map { (my $x = $_) =~ s/ +$//; $x } @array;
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 05 May 1999 03:02:14 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Newbie having problems getting this script to work...
Message-Id: <7gobjr$bvg$1@birch.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
[ alt.perl removed from newsgroup line ]
"Hawkwynd" <hawkwynd@adelphia.net> wrote:
>Here's the script, I'm just too new to know what to do next... I know
>there's areas of this script that are wrong, and I could use a little help
>in this matter:
Looks like you gave it an honest. But please use a more accurate subject
line from now on. Preferably one that doesn't include that
fingernails-across-the-blackboard word "newbie".
>#! perl
Always use the -w switch in your shebang line. It will alert you to
errors and help resolve many possible headaches.
#!c:/perl/bin/perl -w
>$file_dir = "C:\wp"; # Directory contains random # of text files.
Not only can you use a normal whacker (slash) but it won't work the way
you have it.
my $file_dir = 'C:/wp';
>opendir($file_dir, ".") || die("Error: unable to open directory"); # Open
>the directory
You've got the syntax of the opendir all wrong.
perldoc -f opendir
Also check the value of "$!", it holds the reason for failure.
opendir DIR,"$file_dir" or die "Can't open $file_dir: $!";
>@myarray = ((join("\n", readdir($file_dir)). "\n")); # Get all files,
nope:
my @myarray = defined(readdir(DIR));
>place in @myarray
>print (join("\n", readdir($file_dir)). "\n"); # list the files on the
>screen
ewww:
print map { "$_\n" } @myarray;
or
foreach (@myarray) {
print "$_\n";
}
>closedir($file_dir); # Close the dir
close DIR;
>foreach (@myarray) { # One file at a time
>
>open(TEXTF, $myarray) || die("Error: unable to open file $myarray."); #
>Open the file for reading
You haven't declared a $myarray variable and you should be indenting
inside of blocks to make it easier to read.
>@buff = <TEXTF>; # assign to the buffer
>close(TEXTF); # Close file
>
>$myarray = ~s/33_/ /g; # Remove the 33_ prefix from filename
>$myarray = ~s/.txt/ /g; # Remove the .txt extension from filename
There is still no $myarray variable defined.
You need to escape that . (period) and the g switch here is unneeded
unless you plan on having ".txt" in the file more than once.
># $buff = ~s/[\014\015]/ /g; # Remove hex 14 and 15 from the file
You never defined $buff.
I don't know what a \014 is and don't feel like looking it up, but you
have this line commented out anyways so forget it.
>open (WRITEIT, ">$myarray"); # Open a new file, with the new filename
Why aren't you checking the status of this open?
$myarray is still not defined.
>print WRITEIT "$buf"; # Write the file
You never defined $buf.
>close (WRITEIT); # Close the file
>
>print "$myarray completed\n"; # Confirm file is done.
>}
>
>print "Done. \n"; # Exit program
>exit;
This code was a mess, which is just what you expect from somebody new.
But, you need to slow down and take it one step at a time. Learn the
syntax for one function before moving on to the next and don't try and
learn everything at once.
Good luck,
------------------------------
Date: 04 May 1999 23:24:58 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl 5: The Complete Reference, Martin Brown
Message-Id: <x7wvyoyz91.fsf@home.sysarch.com>
>>>>> "TM" == Tad McClellan <tadmc@metronet.com> writes:
TM> This one head me ROTFL:
i was in pain!
TM> <quote>
TM> $hw = { print "Hello World\n";};
TM> </quote>
i tried to run it too just for fun. i think perl tries to parse it as an
anon hash first and then pukes.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 5 May 1999 03:49:21 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Perl 5: The Complete Reference, Martin Brown
Message-Id: <7gof41$omg$1@towncrier.cc.monash.edu.au>
tadmc@metronet.com (Tad McClellan) grammar-flames:
> It isn't even English!
> I thought you weren't supposed to use a preposition to
> end a sentence with.
Tad's right on the money with his other criticisms--such blatant and
foolish mistakes are unpardonable in a professionally published book.
But it's a disservice to propagate (even in jest) the myth of never
ending on a preposition.
That most authoritative of English grammarians, H.W. Fowler, campaigns
vigorously against this "cherished superstition", insisting that "the
legitimacy of the prepositional ending in literary English must be
uncompromisingly maintained."
Of course, deliberately constructed dissonances such as:
"...use a preposition to end a sentence with."
clearly are bad English, but there's absolutely nothing wrong with:
"...expecting to assign the return value to."
If only he or his publisher had been able to spell "to" correctly ;-)
Damian
PSS: Just to forestall the inevitable counter-flames, it's also perfectly
acceptible to begin a sentence with "But..."
------------------------------
Date: Tue, 04 May 1999 20:42:04 -0700
From: Goten <goten@sduteam.com>
Subject: Perl and ping
Message-Id: <372FBE0C.C035D7A5@sduteam.com>
I have a question, I am just wondering if there is any way that I can
code to ping a destination if it is alive or not. However, the server
is known to be behind a firewall, and only one port is open to public.
So, is there anyone know how to code a "ping" program that could ping on
a certain port? I will greatly appreciate for any ideas.
rgd,
Derek
------------------------------
Date: 5 May 1999 03:04:21 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: perl file "busy"? how can that be?
Message-Id: <slrn7ivd9l.g5b.sholden@pgrad.cs.usyd.edu.au>
On Wed, 5 May 1999 02:30:54 GMT, Eric Bohlman <ebohlman@netcom.com> wrote:
>Timothy Larson <larsot2@krypton.mankato.msus.edu> wrote:
>This can't be true. The way CGI works is that the server forks off a new
>process on each hit. Thus even if someone had already invoked your
>script and it was still running, the server would have created an
>entirely new process to run the second invocation. As far as your script
>is concerned, it doesn't even know that another copy of itself is running
>(which is why if it writes to files or otherwise uses shared resources,
>it needs to make sure it doesn't step on anybody's toes.
How do you know this. Maybe on the unnamed mystical platform the poster
is using only one copy of any program can be executed at one time.
--
Sam
If your language is flexible and forgiving enough, you can prototype
your belief system without too many core dumps.
--Larry Wall
------------------------------
Date: 4 May 1999 22:40:24 -0500
From: Tye McQueen <tye@metronet.com>
Subject: Re: question on regex...
Message-Id: <7goej8$l63@fumnix.metronet.com>
) In article <x3yu2tsafsb.fsf@tigre.matrox.com> on Tue, 4 May 1999
) 13:47:00 -0400 , Ala Qumsieh <aqumsieh@matrox.com> says...
) ...
) > @matches = grep { /^\Q$test/ } @grouplist;
lr@hpl.hp.com (Larry Rosler) writes:
) Whenever I see something like this, I wonder why we aren't showing more
) of the 'index' function, which is speedier than cranking up the regex
) engine for each match.
)
) @matches = grep index($_, $test) == 0, @grouplist;
In this case, I think it would be better to use substr():
@matches = grep $test eq substr($_,0,length($test)), @grouplist;
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Wed, 05 May 1999 00:52:39 +0000
From: andrij <andrij@mail.idt.net>
Subject: Script question - please help !
Message-Id: <372F9655.F8366C37@mail.idt.net>
Hello all.
I need help with putting together a script, and I was hoping someone
here could help me. I have a web-site that displays information results
based on user input of a couple
of fields. I want to put those fields on a banner so that a user can
select them from a
drop-list, and then click on ta submit button to take them to my site,
which will already be
displaying the results based on the user input on the banner.
I guess my script is doing just the same as it does from my site, except
it has to take the
information from the banner instead, and execute when the user hits
submit on the banner.
I've seen this done before, but I dont know how to do it. Can anyone
help? Thanks
again for everyone's help, and please email me if you can.
- Christine
------------------------------
Date: Tue, 4 May 1999 23:11:56 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: startup opportunity: Minnesota
Message-Id: <1drayiv.zc98llbns603N@p31.tc2.state.ma.tiac.com>
<scottje@gte.net> wrote:
> If you are perl programmer with search engine experience and interested an
> opportunity to get in on a business before the rest of the world recognizes a
> good idea, then we should talk. If you have CGI skills it would be a huge
> plus. No more info without a signed non-disclosure. Email me back if
> interested.
Wow.... They won't even let you discuss the remuneration with people
outside the company...
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 4 May 1999 23:11:57 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Stumped on Regex routine
Message-Id: <1draykl.u815eo1cql105N@p31.tc2.state.ma.tiac.com>
Uri Guttman <uri@sysarch.com> wrote:
> >>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:
>
> DC> Eric Bohlman wrote:
> >>
> >> Ala Qumsieh <aqumsieh@matrox.com> wrote:
> >>
> >> : $Url =~ s-/[^/]+$--;
> >>
> >> Anyone who would choose a delimiter like that is badly in need of being
> >> whipped with a cat-o'-nine-tails made out of overcooked fettucine.
>
> DC> I like using # as an alternate delimiter, but that plays havoc with
> DC> poorly-written comment strippers...
>
> i like using | since i rarely use it inside. my next choice then is
> some form of {} or [], especially for extended multiline ones with comments.
>
> # bothers my eyes and - is horrible! i can tolerate seeing ! sometimes.
I use semi-colons. Like this:
$Url =~ s ;/[^/]+$ ; ;ex ;
As you can see, I also prefer to precede each semi-colon with a space.
;)
(Sorry Uri, couldn't resist!)
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 4 May 1999 23:11:59 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: syswrite() lies
Message-Id: <1drayts.i3yr121gws7q3N@p31.tc2.state.ma.tiac.com>
<elderr@us.ibm.com> wrote:
> However NT likes to add control Ms to every line of text so that I get more
> than a 2048 byte file (2073 bytes) even though it reports it wrote 2048KB.
> Does any one know how to stop the mangling of the buffer?
binmode()?
Try the perlfunc documentation.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
perl -le 'print "Just another \u$^X hacker"'
------------------------------
Date: Wed, 05 May 1999 03:06:19 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: WebEvent 3.1 BETA released - Web / CGI/ WWW Calendar Software
Message-Id: <LAOX2.1534$iu1.1552@news.rdc1.tn.home.com>
>BETA 9.
Obviously the marketing group was not at this meeting. :)
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5566
**************************************