[13137] in Perl-Users-Digest
Perl-Users Digest, Issue: 547 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 15 21:07:23 1999
Date: Sun, 15 Aug 1999 18:05:09 -0700 (PDT)
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, 15 Aug 1999 Volume: 9 Number: 547
Today's topics:
Re: Array/list/split/push handling question (Martien Verbruggen)
Re: Array/list/split/push handling question (Martien Verbruggen)
Re: Creating hotlinks out of plain URLs in Perl. <sunfox@sunwerx.com>
Re: HARASSMENT -- Monthly Autoemail <nobody@wants.spam>
Re: HARASSMENT -- Monthly Autoemail <urielw@tiac.net>
Re: HARASSMENT -- Monthly Autoemail (John Stanley)
Re: HARASSMENT -- Monthly Autoemail (Anno Siegel)
Help : Problem with GD : Bad free() . <oliver.james.jh@bhp.com.au>
Re: How to LOCK files with perl on Windows systems? dunrobin52@hotmail.com
Re: HTTP redirect..not working <sunfox@sunwerx.com>
Re: mod_perl is in the Fortune 500 (and elsewhere) <jeff@vpservices.com>
Re: Need help using OO Perl (Abigail)
Re: Need help: double-byte coded text processing (Abigail)
Newbie needs help with explicit package name. Using "st <shtml@usa.net>
Re: Newbie: MailTo Script Problem? (Abigail)
Re: Performance difference printing single vs double qu <chi@cybie.com>
Re: Performance difference printing single vs double qu (Abigail)
Re: Performance difference printing single vs double qu <mike@crusaders.no>
Re: PERL on Windows: Print displays only blank lines (Abigail)
Re: problem printing ("html") <flavell@mail.cern.ch>
Rolling my own Newsreader (Kirk Is)
Re: Rolling my own Newsreader <mike@crusaders.no>
Re: Things my math teacher forgot to tell me (Anno Siegel)
Why use Python when we've got elisp? (was: Re: Why use <cmcurtin@interhack.net>
Re: Why use Python when we've got Perl? <robin@jessikat.demon.co.uk>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 16 Aug 1999 00:07:17 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Array/list/split/push handling question
Message-Id: <VCIt3.43$Cb2.3834@nsw.nnrp.telstra.net>
In article <7p64a3$40l$1@nnrp1.deja.com>,
marcza@my-deja.com writes:
> Suppose the follwoing string
> $text = "aaa bbb ccc ddd eee fff";
> Now I want to skip the first 3 words (delimited by space)
(Copying your definition of 'delimited by space' from your code
example)
with grep and split:
$i = 0;
@a = ($new, grep( ++$i > 3, split(/ +/, $text)));
or with map and split:
$i = 0;
@a = map { $i++ == 0 ? $new : $i > 3 ? $_ : () } split / +/, $text;
or this will work for any whitespace, not just spaces (but so will a
split with ' ' as its first argument), using the autosplit qw thingy;
$i = 0;
@a = map { $i++ == 0 ? $new : $i > 3 ? $_ : () } eval "qw($text)";
or using map, split and splice with a temporary array:
@a = map { my @a = split / +/; splice @a, 0, 3, $new; @a} $text;
or without the use of a temporary array (note that the splice has been
reversed):
@a = map { ($new, splice @{[split / +/]}, 3) } $text;
or if you don't like map (and it is of course a bit silly here):
@a = ($new, splice @{[split / +/, $text]}, 3);
or, and this is probably what you really want to do:
@a = split / +/, $text;
splice @a, 0, 3, $new;
TMTOWTDI
Martien
--
Martien Verbruggen |
Interactive Media Division | Think of the average person. Half of
Commercial Dynamics Pty. Ltd. | the people out there are dumber.
NSW, Australia |
------------------------------
Date: Mon, 16 Aug 1999 00:50:18 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Array/list/split/push handling question
Message-Id: <efJt3.132$Cb2.4074@nsw.nnrp.telstra.net>
In article <VCIt3.43$Cb2.3834@nsw.nnrp.telstra.net>,
mgjv@comdyn.com.au (Martien Verbruggen) writes:
[snip suggestions]
If you wonder which one is fastest:
use Benchmark;
$text = 'aaa bbb ccc ddd eee fff';
$new = 'newelem';
timethese (1 << 16, {
'1' => '@a = ($new, grep( ++$i > 3, split(/ +/, $text)))',
'2' => '$i = 0;
@a = map { $i++ == 0 ? $new : $i > 3 ? $_ : () } split / +/, $text',
'3' => '$i = 0;
@a = map { $i++ == 0 ? $new : $i > 3 ? $_ : () } eval "qw($text)"',
'4' => '@a = map { my @a = split / +/; splice @a, 0, 3, $new; @a} $text',
'5' => '@a = map { ($new, splice @{[split / +/]}, 3) } $text',
'6' => '@a = ($new, splice @{[split / +/, $text]}, 3)',
'7' => '@a = split / +/, $text; splice @a, 0, 3, $new',
});
Benchmark: timing 65536 iterations of 1, 2, 3, 4, 5, 6, 7...
1: 5 secs ( 4.30 usr 0.00 sys = 4.30 cpu)
2: 5 secs ( 4.57 usr 0.00 sys = 4.57 cpu)
3: 15 secs (14.63 usr 0.00 sys = 14.63 cpu)
4: 5 secs ( 4.94 usr 0.00 sys = 4.94 cpu)
5: 5 secs ( 4.32 usr 0.00 sys = 4.32 cpu)
6: 4 secs ( 3.87 usr 0.00 sys = 3.87 cpu)
7: 2 secs ( 1.58 usr 0.00 sys = 1.58 cpu)
No spurprise there.
Martien
--
Martien Verbruggen |
Interactive Media Division | The gene pool could use a little
Commercial Dynamics Pty. Ltd. | chlorine.
NSW, Australia |
------------------------------
Date: Sun, 15 Aug 1999 23:59:06 GMT
From: "Sunfox" <sunfox@sunwerx.com>
Subject: Re: Creating hotlinks out of plain URLs in Perl.
Message-Id: <evIt3.105906$U42.135154@news1.rdc1.bc.home.com>
Abigail wrote in message ...
>Sunfox (sunfox@sunwerx.com) wrote on MMCLXXV September MCMXCIII in
><URL:news:M%Ft3.105842$U42.130683@news1.rdc1.bc.home.com>:
>
>|| format - <A HREF="http://www.blah.com">http://www.blah.com">.
>
>That's an unclosed anchor element.
Sorry, mere typo.
>It's a bit more complicated than that.
So it would seem!
>Sure. Assume your text is in $text.
<SNIP>
Wow, that's quite impressive... and it works! Amazing! Now, one further
question: is there any way to detect if the <A HREF= part is already in a
particular URL and not do anything in that case? Lastly, is there a
formatted version of this anywhere? I'm trying to remove those that I don't
really need (what's vemmi:// or prospero://?) but as it's all run together
it's a tad hard.
I've located http, ftp, news, nntp, telnet, gopher, wais, mailto, file,
prospero, ldap, cid, mid, vemmi, imap and nfs... are there others in there?
I'd like to thank you very much for that incredible bit of code.
- Sunfox
------------------------------
Date: Sun, 15 Aug 1999 20:05:35 -0400
From: "Curly++" <nobody@wants.spam>
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <7p7kht$4p5$1@news2.tor.accglobal.net>
Uriel Wittenberg <urielw@tiac.net> wrote in message news:37B6D3B7.9A8E934C@tiac.net...
> Jim Seymour wrote:
>
> > In article <37B43687.B0525875@tiac.net>,
> > Uriel Wittenberg <urielw@tiac.net> writes:
> > [snip]
> > >
> > > Regardless of anyone's position on posting style, I would hope just
> > > about everyone understands the vindictive and antisocial nature of
> > > such behavior.
> >
> > Assuming that Tom's remarks wrt to your posting style are
> > accurate: I might as well argue that your posting style is
> > "anti-social."
Hmm. True, but not very helpfull. By "Assuming", JS
reveals that he didn't bother to look at your postings
and is therefore simply hopping on a bandwagon without
any idea what he's talking about. Very bad netiquette
on JS's part. A waste of bandwidth.
> Yes, I erred horribly ... horribly. But anyone who cares to review the thread which
> prompted Tom's aggression ("Re: Documenting character encoding --
> comments/corrections?", on comp.infosystems.www.authoring.html) can see I was more
> than ready to promptly correct any protocol breach that was brought to my
> attention. In other words, Tom's goon tactics were wholly gratuitous.
All very true. However, bear in mind you still
transgress badly in other ways. You cannot correct all
your errors in one day, so please be patient with those
who have not yet learned tolerance.
> The irony is considerable. Tom Christiansen's own post in the above-mentioned
> thread, sent around the same time he lobbed his clever grenade at me, uses a full
> 18 lines to promote the entry of hard RETURN's when composing messages.
Hard returns are strongly recommended. Many
newsreaders do not display the text beyond 80 collumns.
As for that ugly software autowrap, it doesn't work.
Have some consideration for people who wear glasses,
you are causing unnecessary eyestrain. I had to
maximize my window to be able to read your message,
even though I am using "more modern software". In
fact, I use both OE5 and NN4.61. Are you using
something more modern and magical that can do what
these packages can't? No, I see you use NN4.61.
Obviously, you don't understand how and why it fails,
so why not accept the advice of people obviously more
experienced than you?
> This is obviously on-topic for his supporters; others may wonder about their
> Kool-Aid.
And for his detractors, too. Unfortunately, it had to
be decided years ago that correcting a newbie's
netiquette cannot be completely off-topic in any
newsgroup. It is the least evil of the alternatives.
> In passing, he misquotes a Netscape designer and offers a piercing criticism of the
> Netscape interface ("totally fucked up").
He's allowed his opinion. It is on topic since you had
used it to defend your lack of proper margins. BTW, I
think he's right about Netscape, I think it's very,
very bad software. I'm entitled to this opinion, I use
Netscape.
> Frankly, I find it unbelievable that anyone's defending this guy. What kind of
> place is the Internet?
Perhaps you meant to ask "What kind of place is usenet?"
Usenet is loose conglomeration of individuals connected
part time by an email application and sharing only the
ability to exchange ASCII formatted messages.
Notice that part about having just ASCII in common.
I'm not kidding, Uriel. People can, should and _do_
access usenet from a wide variety of platforms. They
come from widely differing cultural backgrounds and
speak different languages and have different economic
situations. This variety is a very good thing. Stop
thinking that your propiertary, non-compatible and
incredibly buggy software is the panacea for
everyone's problems. Explaining why this is wrong is
a long and massively off-topic discussion. Take the
word of the experts here and elsewere, you are wrong
on this point. Some of those people have been there,
found out they were wrong, been mildly embarrassed,
and are now giving you good advice that you choose
to ignore. Here are some clues for you Uriel, maybe
a few other people should read them too:
o No software has been written that wraps properly.
I use both OE5 and NN4.61 and the autowrap in both is
badly flawed and unuseable. I also use 3 other
newsreaders on occassion and they don't have autowrap.
I regularly use 7 different operating systems and
often have to work on 80 collumn screens. Telling
everyone that things are better "on ng's where people
use more modern apps" is about like saying that things
would be better if we didn't allow foriegners in here.
o There is no such thing as unanimous agreement in
usenet. Try posting that grass is green and you'll
get 14 different dissenting opinions. Assuming you
didn't cross-post of course, then you'll get more.
Don't expect agreement with your ideas or
conclusions, just discussion. When the discussion
is done, your conclusions don't need to be posted
back to the ng unless they might help someone else
or incite further _usefull_ discussion.
o Cross-posting is a bad idea. There are seperate
newsgroups because there are seperate topics. If you
feel the need to cross-post it is probably because
you are off topic in the first place. This issue
should have been taken to your ISP and the alleged
offender's ISP, not the newsgroups. Don't crosspost
more than twice per decade. Ok, I'm kidding, there
is no hard and fast limit. Crossposting garantees
that not only your message, but all replies will be
off topic in at least one newsgroup.
o Read your own messages before posting them. If you
are replying, read the original _again_ before
pressing send. Then go back and re-read your own
posting before pressing send. Be prepared to rewrite
or even delete your message if you realize you are off
topic, argumentative or unhelpfull.
o Be tolerant. This is the single most important
part of good netiquette. If you scan this newsgroup
(CIWAH) you will find that most postings break
netiquette by being unnecessarily wrong, rude,
intollerant, off-topic, unhelpfull or badly formatted.
Before you point this out to an offender, remind
yourself that such complaints are off topic. If 80%
of the postings are agravating and one person
complained in the ng about each bad message, the rate
of good messages would drop from 20% to 10%. That
would be a very bad result of very good intentions.
The most important part of tolerance is keeping
complaints out of the newsgroup. If it's so bad,
move on to the next message!
o Usenet is not free. Be aware that someone,
somewhere is paying real money for everything you
type. Some people pay directly for usenet access,
everyone benefits from the sponsorship of governments,
schools and corporations that pay the massive bills
for communications, storeage and management of usenet.
When someone tells you you are wasting bandwidth, they
mean you are wasting other poeple's money.
Uriel, you really are a clueless newbie, but you're not
the only one here and not the worst by far. It's the
long standing clueless newbies that aggravate me most.
Look at the actions of some of the most intellegent,
interesting, helpfull and downright fascinating people
here: TC is abusing his experience by harrassing
newbies; AJ is preaching SGML as the savior of mankind
without explaining how private individuals can use it;
DrClue is promoting HTML style in such badly worded
messages that most people think he means how they indent
their HTML source. No one is perfect, not you, not me,
not them.
I hope AJ and DrClue are tolerant enough to forgive me
for using them as examples! As for TC, I don't care
what a spammer thinks of me.
Uriel, I learn from the discussions about your
questions, so please learn a little manners so those
dicussions can continue teaching me.
--
Oisin "Curly++" Curtin
I HAVE MAIL: curlyplusplus@NOSPAM@crosswinds.net
<sigh> Do the usual cleanup.
Coming soon: http://www.crosswinds.net/~curlyplusplus
------------------------------
Date: Sun, 15 Aug 1999 19:17:57 -0400
From: Uriel Wittenberg <urielw@tiac.net>
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <37B74AA4.832A166D@tiac.net>
"Daniel R. Tobias" wrote:
> Uriel Wittenberg wrote:
> >
> > Yes, I erred horribly ... horribly. But anyone who cares to review the thread which
> > prompted Tom's aggression ("Re: Documenting character encoding --
> > comments/corrections?", on comp.infosystems.www.authoring.html) can see I was more
> > than ready to promptly correct any protocol breach that was brought to my
> > attention. In other words, Tom's goon tactics were wholly gratuitous.
>
> And wasn't that exactly what Tom was doing? Bringing your protocol
> breach to your attention?
>
> Just how are newbies *ever* supposed to learn the basics of netiquette
> in the future, if people like you are so intent on insisting that the
> "oldtimers" be "nicey-nicey" and never do anything so rude as to
> actually tell a newbie that something they did was wrong?
>
> --
> --Dan
> Dan's Web Tips: http://www.softdisk.com/comp/dan/webtips/
Dan, this is so perfect. I couldn't ask for a better example of what I said in the very
post you are replying to:
The greatest irony is that for all the protracted discussions of posting protocols,
html esoterica, bandwidth concerns, the record shows people talking at cross
purposes; misunderstanding simple English; failing, in short, to communicate.
------------------------------
Date: 16 Aug 1999 00:44:22 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <7p7mt7$em0$1@news.NERO.NET>
In article <37bf42e2.20734392@news.erols.com>,
Dave Salovesh <darsal@erols.com> wrote:
>In article <37b7130f.894473@news.interpath.net>,
>gh@netquick.net (Gil Harvey) opined:
>
>> Unsolicted mail is unsolicted mail - No?
>
>Absolutely.
>
>But posting to Usenet solicits replies via email -or- via the newsgroup.
>
>Who told you different?
Someone who speaks the truth. Posting to USENET does not solicit email.
If it did, then every UCE you get that starts with "saw your posting in
USENET, thought this might be of interest" is something you solicited.
------------------------------
Date: 16 Aug 1999 00:52:36 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <7p7nck$ec$1@lublin.zrz.tu-berlin.de>
Uriel Wittenberg <urielw@tiac.net> wrote in comp.lang.perl.misc:
[lost of badly formatted text snipped]
>Frankly, I find it unbelievable that anyone’s defending this guy. What kind of
>place is the Internet?
A big one, where you get all sorts of folks.
>But I think I may understand this passion about Netscape and Windows. It appears
>there are still people surviving today who enter text into computers the way people
>used to type on typewriters decades ago, monitoring their horizontal position and
>hitting RETURN at regular intervals. The only way, some seem to think, to achieve
>"writer-directed formatting."
By all means, keep your cherished auto-wrap. But until you've learned
to use it, keep it to yourself.
Anno
------------------------------
Date: Mon, 16 Aug 1999 09:46:34 +1000
From: "James Oliver" <oliver.james.jh@bhp.com.au>
Subject: Help : Problem with GD : Bad free() .
Message-Id: <7p7jje$68g8@atbhp.corpmel.bhp.com.au>
Hello,
I am having a problem with the GD.pl library. I am creating an image and
adding lines, text, etc. to it.
When I try to generate it as a GIF image, I get the following error message:
"Bad free() ignored at make_ping_graph.pl line 303."
A synopsis of the code is below, and I am unable to see any difference
between this and the help pages.
Any suggestions or assistance would be appreciated.
Best regards,
James Oliver
my $im = new GD::Image($max_x,$max_y); # The image we write to.
my ($black,$white,$red,$blue,$yellow) = allocate_colours($im);
# make the background transparent and interlaced
$im->transparent($yellow);
$im->interlaced('true');
# Put a black frame around the picture
$im->rectangle(0,0,$max_x-1,$max_y-1,$black);
# Put an inner frame.
$im->rectangle($min_x_r,$min_y_r,$max_x_r,$max_y_r,$black);
open(IMG_FILE,"> $img_file") || die("Couldn't open file
$img_file\n");
binmode IMG_FILE;
# Convert the image to GIF and print it on standard output
>> my $im_gif = $im->gif; ## This is line 303********************
print IMG_FILE $im_gif || die("Cannot write file $img_file\n");
close(IMG_FILE);
chmod(0777,$img_file);
------------------------------
Date: Mon, 16 Aug 1999 00:24:41 GMT
From: dunrobin52@hotmail.com
Subject: Re: How to LOCK files with perl on Windows systems?
Message-Id: <37b759ce.35098818@netnews.worldnet.att.net>
On Sun, 1 Aug 1999 12:27:45 +1000, e-lephant@b-igpond.com (elephant)
wrote:
>Alexander Rühl writes ..
>>I tested it under Win98 - but there isn't a 'flock'. It should run on a
>>WinNT webserver later - is there a 'flock' or something similar?
>>How can I realize the file locking on Windows based systems?
>
>assuming that you're using the ActiveState port of perl .. then all the
>information on flock's usage in Win9x and WinNT is provided for you in
>the FAQ
>
> perlwin32faq5.html (Quirks)
...where you'll discover that flock doesn't work on Win9x. End of
story.
>and advised reading would also be the 'flock' documentation in perlfunc
>
> perldoc -f flock
>
>in which it mentions file locking in WindowsNT systems
------------------------------
Date: Sun, 15 Aug 1999 23:58:27 GMT
From: "Sunfox" <sunfox@sunwerx.com>
Subject: Re: HTTP redirect..not working
Message-Id: <DuIt3.105905$U42.134962@news1.rdc1.bc.home.com>
Alan J. Flavell wrote in message ...
>On Sun, 15 Aug 1999, Sunfox wrote:
>
>> Print this out instead:
>> print "Content-type: text/html\n";
>
>What's that for? A Location CGI response doesn't need a content-type.
>
>> print "Location: http://www.foo.com/index.html\n\n";
>> Works for me.
>
>Lots of bizarre things can be made to look as if they're working.
>Doesn't necessarily mean they're right.
So, just print the "Location:" portion. That also works just fine (now that
I check my actual scripts, I'm only using Content-type on actual HTML
output).
>Oh look, you hung the entire previous content on the end of your f'up.
Wasn't exactly a great amount of text, y'know. It appears a few of the folks
in here should be on some sort of mood tranquilizer. Lighten up, dude.
- Sunfox
------------------------------
Date: 15 Aug 1999 22:23:44 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: mod_perl is in the Fortune 500 (and elsewhere)
Message-Id: <37B73D0A.ECDDE9F@vpservices.com>
brian d foy wrote:
>
> after a quick server of the web servers of the Fortune 500 companies,
> i found several using mod_perl:
>
> [snip: see bottom of post for brian's survey results]
And here are the same stats for U.S. federal government servers. I took
a list of 613 servers found at http://www.lib.lsu.edu/gov/fedgov.html
and fed it to brian's LWP script. The results are listed below. Notice
a significantly higher percentage of Apache and other
non-Netscape/non-MS servers than in the Fortune 500 list.
Netscape-Enterprise* 172 28%
Microsoft-IIS** 156 25%
Apache 144 23%
NCSA 19 3%
WebSitePro 13 2%
Lotus-Domino 12 1%
WebSTAR 11 1%
Stronghold 6
CERN 3
Oracle_Web_Listener 3
WebSite 3
Purveyor Encrypt Domestic 2
Domino-Go-Webserver 2
ConcentricHost-Ashurbanipal 2
OSU 2
Other 8
unknown 52 8%
* Netscape includes
Netscape-FastTrack 8
Netscape-Communications 3
Netscape-Commerce 2
** Microsoft includes
Microsoft-Internet-Information-Server 1
And the list of apache modules on these servers:
http://www.arl.noaa.gov/
Apache/1.3.6 (Unix) mod_fastcgi/2.2.2
http://www.cdc.noaa.gov/
Apache/1.3.6 (Unix) mod_perl/1.19
http://www.doe-md.com/
Apache/1.3.6 (Unix) mod_perl/1.19
http://www.emsl.pnl.gov/
Apache/1.3.6 (Unix) mod_ssl/2.3.1 OpenSSL/0.9.3a
http://supct.law.cornell.edu/
Apache/1.3.3 (Unix) mod_perl/1.16
http://www.fedcir.gov/
Apache/1.3.6 (Unix) mod_frontpage/3.0.4.3
http://www.armfor.uscourts.gov/
Red Hat Secure/2.0 (Unix) mod_ssl/2.0.7 SSLeay/0.9.0b
http://www.eni-environment.net/
Apache/1.3.6 (Unix) mod_frontpage/3.0.4.3
http://www.achp.gov/
Apache/1.3.6 (Unix) ApacheJServ/1.0b3 PHP/3.0.7 mod_fastcgi/2.2.1
mod_ssl/2.2.6 OpenSSL/0.9.2b
http://www.liegeweb.com/
Apache/1.3.6 (Unix) PHP/3.0.7 mod_ssl/2.2.8 OpenSSL/0.9.2b
http://www.fedstats.gov/
Apache/1.3.6 (Unix) mod_perl/1.21 PHP/3.0.11 mod_fastcgi/2.2.2
http://www.fedlabs.org/
Apache/1.3.4 (Unix) mod_ssl/2.2.0 SSLeay/0.9.0b
--
Jeff Zucker
>
> RANK | COMPANY NAME | WEB ADDRESS | mod_perl
> 37 Merck http://www.merck.com 1.16
> 52 BellSouth http://www.bellsouthcorp.com 1.00
> 232 Marsh & McLennan http://www.marshmac.com 1.20
> 310 MBNA http://www.mbnainternational.com 1.18
> 353 Litton Industries http://www.littoncorp.com 1.03
> 418 Estee Lauder http://www.elcompanies.com 1.16
> 421 Consolidated Natural http://www.cng.com 1.16
> 479 Phelps Dodge http://www.phelpsdodge.com 1.18
> 481 Fleetwood Enterprise http://www.fleetwood.com 1.19
>
> if you are interested, the web servers broke down roughly like this:
>
> Netscape Enterprise: 194 38.8%
> Microsoft IIS: 174 34.8%
> Apache: 72 15.6% (including Stronghold servers)
> Domino: 12
> Stronghold: 6
> NCSA: 5
> WebSitePro 4
> Open-Market-Secure 4
> Oracle_Web_View 3
> WebSTAR 2
> Other 2
> Unknown 22 4.4% unknown
>
> [again, with a little bit of Perl and LWP, collecting this data was a
> piece of cake. here's a little tool i wrote to grab the server string
> from an HTTP response - just feed it HTTP addresses one per line:
>
> #!/usr/bin/perl
>
> use LWP::UserAgent;
> $ua = new LWP::UserAgent;
>
> while( <> )
> {
> chomp;
>
> my $res = $ua->request(new HTTP::Request GET => $_);
>
> if ($res->is_success)
> {
> my $server = $res->header('Server');
> print "$_\t$server\n";
> }
> else
> {
> print "Could not determine server for $_\n";
> }
> }
> __END__
>
> ]
>
> --
> brian d foy
> CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
> Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: 15 Aug 1999 18:13:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Need help using OO Perl
Message-Id: <slrn7reiej.81j.abigail@alexandra.delanet.com>
Benjamin Bérubé (berube@odyssee.net) wrote on MMCLXXI September MCMXCIII
in <URL:news:7oqkcv$mr1$1@news.quebectel.com>:
""
"" Cool. My questions are as follow.
""
"" (1) What means using ${} as in the following line ?
"" ${$object->{'array'}}[$counter] = "titi".$counter;
"" I think it's some sort of getting the scalar at the position pointed in the
"" array.
That's strange. Why did you write it if you don't know what it means?
How did you come up with this? Unless you've read the manual, I can't
believe anyone guessing the syntax; but if you read the manual, shouldn't
you know? Anyway, I suggest you look it up in the manual.
"" (2) How can I use some sort of variable that would be a pointer to
"" $object->{'counter'} (for example) so that I could do :
"" $pointer = 4; # assuming that $pointer points to the counter of the
"" current object
"" This way, if I would do :
"" print $object->{'counter'};
"" I would get "4".
You could alias it using symbolic references. Or use a tied object.
"" (3) Same question as before, but a pointer to the $object->{'array'} so that
"" I could do :
"" print @array;
"" or
"" $array[$pos] = "blabla";
Same question, same answer.
"" For both question two and three, I read something about using the * like in
"" *pointer, but i'm not getting how it works.
A * indicates a typeglob. There are no pointers in Perl!
"" Any help will be appreciated. Also, let me know if the way i'm doing my
"" class is "the way to do it".
Well, I would certainly use the 2 arg form of bless.
And I would write $object -> {array} -> [$counter].
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Aug 1999 18:05:34 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Need help: double-byte coded text processing
Message-Id: <slrn7rehvr.81j.abigail@alexandra.delanet.com>
Horace Ho (horaceho@geocities.com) wrote on MMCLXXIV September MCMXCIII
in <URL:news:37B507B0.D0CF3EE5@geocities.com>:
"" I'd like to remove all CR, LF, Tab, and space from
"" double-byte coded (BIG5) Chinese text. Could someone
"" please show how to do that?
That's pretty basic stuff that's dealt with in perlre.
Please read the documentation, try out some code, and if you fail,
show us what you have done, and why it fails.
We're not going to do your work.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 15 Aug 1999 19:32:55 -0500
From: Joe L <shtml@usa.net>
Subject: Newbie needs help with explicit package name. Using "strict"
Message-Id: <37B75C36.97138A12@usa.net>
Hi,
I have written several scripts before now but I
"discovered" the module strict about a week
ago.
Now, needless to say I have about 5 million of
these errors: "$output_data" requires explicit
package name at ./myscript.pl." Of course each
error uses a different named variable.
Although my scripts run when I don't use strict, I
would like to learn the correct way. I have
spent several hours reading the FAQs and other
docs on the subject. If I declare or define a
variable with "my" or "local" the error from
strict goes away. The way I understand to declare
or define a variable is to do it just before I am
going to use it. Is this correct? Does it seem to
you that I have a fair understanding of declaring
and defining variables? Just using my or local
"seems too easy" to me. Is it that easy? Am I
trying to make this too hard? I don't mean to
waste anyone's time on this, it's just that it
seems very important and I just can't get it
though my thick head! Thanks for any and all help.
Joe L
------------------------------
Date: 15 Aug 1999 18:20:14 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Newbie: MailTo Script Problem?
Message-Id: <slrn7reird.81j.abigail@alexandra.delanet.com>
Yellow Beetle (firebrand@mail.usa.com) wrote on MMCLXXI September
MCMXCIII in <URL:news:7osis7$d50$1@garnet.nbnet.nb.ca>:
== Hi,
==
== I have a site at:
== www.skyfamily.com/firebrand
==
== Now under the "comments" tab you can fill in some
== information, and send it using the "submit" button.
==
== The problem I have is that when you hit "submit"
== you get a message saying, that this is not encrypted,
== and that you will reveal your e-mail address.
==
== Is there any way in Perl that I can have it look
== more professional? I really don't like having that pop
== up message.
Well, get a browser that doesn't do that. Oh, you want to change the
behaviour of someone else browsers? Now, why do you want to do that?
If it's to harvest email address, that's too bad for you. The reason
browsers pop up such a message is to *prevent* that from happening.
Sucks to be a spammer, doesn't?
== Also, my server doesn't support Perl,
== and I can't move the page. Can I link this information
== toa site that does support Perl?
I don't see why not.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 15 Aug 1999 16:05:33 -0700
From: Chi Yu <chi@cybie.com>
Subject: Re: Performance difference printing single vs double quote?
Message-Id: <37B747BD.6F3489FE@cybie.com>
Thank you Jeff & Uri for your prompt replies. Thank you Jeff for the
benchmarking routine. I will try it with some other statements to
satisfy my curiosity.
Best regards,
Chi Yu
Jeff Pinyan wrote:
>
> [posted & mailed]
>
> On Aug 15, Chi Yu blah blah blah:
> > Is there an appreciable performance gain in printing static text using
> > single quotes versus standardizing on double quotes for both static and
> > dynamic strings?
>
> I would hardly call the following results an "appreciable" difference:
>
> Unless you consider 0.0000002 seconds a "lag". :)
>
> #!/usr/bin/perl -MBenchmark=timethese
>
> ($his,$s,$n) = ("aaaa","aa","aa);
> open OUT, ">/dev/null";
>
> timethese(50_000, {
> double_str => q{ print OUT "this is in quotes" },
> douvar_str => q{ print OUT "$his $s $n quotes" },
> single_str => q{ print OUT 'this is in quotes' },
> sinvar_str => q{ print OUT '$his $s $n quotes' },
> });
>
> # Benchmark: timing 50000 iterations of [snip]
> # double_str: 1 wallclock secs ( 0.66 usr + 0.00 sys = 0.66 CPU)
> # douvar_str: 2 wallclock secs ( 1.45 usr + 0.01 sys = 1.46 CPU)
> # single_str: 1 wallclock secs ( 0.64 usr + 0.00 sys = 0.64 CPU)
> # sinvar_str: 1 wallclock secs ( 0.64 usr + 0.01 sys = 0.65 CPU)
>
> --
> jeff pinyan japhy@pobox.com japhy+perl@pobox.com japhy+crap@pobox.com
> japhy's little hole in the (fire) wall: http://www.pobox.com/~japhy/
> japhy's perl supposit^Wrepository: http://www.pobox.com/~japhy/perl/
> The "CRAP" Project: http://www.pobox.com/~japhy/perl/crap/
> CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
------------------------------
Date: 15 Aug 1999 18:35:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Performance difference printing single vs double quote?
Message-Id: <slrn7rejnb.81j.abigail@alexandra.delanet.com>
Uri Guttman (uri@sysarch.com) wrote on MMCLXXV September MCMXCIII in
<URL:news:x7wvuw3fmw.fsf@home.sysarch.com>:
??
??
?? it is far more important to use the quotes that properly convey the
?? meaning of what you are doing in the string. single quoted strings ('
?? and its sibling q{} ) have no interpolation or backslashed char
?? insertion (\n and friends). double quoted strings (" and its sibling
?? qq{}) will have interpolation. so if you just need a fixed string
?? without any interpolation, use single quotes, otherwise use double
?? quotes.
Why? I tend to use "", unless I really want to prevent interpolation or
have a " in it. C<print "foo"> is unlikely to change to C<print '$foo'>,
while changing it to C<print "foo\n"> is more likely.
And changing C<"foo"> to C<"foo\n"> is easier than changing C<'foo'>
to C<"foo\n">. I don't buy this C<"foo"> is a fixed string without any
interpolation, hence you should use C<''>. C<"foo"> does do interpolation;
it's just that the number of interpolated tokens is 0. For the same
reason, C<""> is a string, and it's not something special cause it
doesn't contain characters.
I always try to keep in mind "what might I change?" when coding.
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 16 Aug 1999 02:12:39 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Performance difference printing single vs double quote?
Message-Id: <_GIt3.768$U36.4452@news1.online.no>
Uri Guttman <uri@sysarch.com> wrote in message
news:x7wvuw3fmw.fsf@home.sysarch.com...> it is far more important to use the
quotes that properly convey the
> meaning of what you are doing in the string. single quoted strings ('
> and its sibling q{} ) have no interpolation or backslashed char
> insertion (\n and friends). double quoted strings (" and its sibling
> qq{}) will have interpolation. so if you just need a fixed string
> without any interpolation, use single quotes, otherwise use double
> quotes.
I tend to use "" all the time when I write programs, and I suspect that this
is because the Norwegian grammatical use of "" and '' is the opposite of the
American.
Grammar can be a pain :)
On a side note. How does concatenation perform compared to variable
interpolation?
I've seen plenty of programs that seem to have been written by authors that
have a serious aversion for variable interpolation, so statements like:
$string = 'the value of $foo is: ' . $foo . ' and the value of $bar is: ' .
$bar . "\n";
is quite common.
While I would prefer:
$string = "the value of \$foo is $foo and the value of \$bar is $bar\n";
Is this just a matter of personal preference and style?
--
Trond Michelsen
------------------------------
Date: 15 Aug 1999 18:55:07 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: PERL on Windows: Print displays only blank lines
Message-Id: <slrn7reksq.81j.abigail@alexandra.delanet.com>
netnews.msn.com (isputnik@email.msn.com) wrote on MMCLXXII September
MCMXCIII in <URL:news:eQutlBE5#GA.120@cpmsnbbsa03>:
.. I moved some of my Unix Perl scritps to Windows NT. The basic Print command
.. doesn't work NT - Is there any environement setup that needs to be done?
Perhaps because 'Print' is spelled 'print'? And 'PERL' is spelled 'Perl'.
I don't really believe you that print doesn't work on NT - or at least
that it's Perls fault. You should of course consider that you moved your
programs for a reliable, user friendly OS to some utter crap.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 16 Aug 1999 01:22:52 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: problem printing ("html")
Message-Id: <Pine.HPP.3.95a.990816010734.11653A-100000@hpplus03.cern.ch>
On Sun, 15 Aug 1999 inlandpac@my-deja.com wrote:
>
> > Please excuse my ignorance
>
> Not a problem. I would refrain from making that statement in this
> forum. Some people will give you are hard time about that.
They sure will. At the drop of a hat someone will pop up and tell you
to "try this", and then give you some speculative answer that might or
might not have the slightest relevance to your problem, without
explaining where you might go to learn more.
> You should read further on output.
Pardon?
> Also, you need to make sure interpreter line is correct!
True (leaving aside the question of whether Perl is really an
"interpreter")
> It is #!usr/local/bin/perl, not #!usr/bin/perl
How can you be so sure of that? Do you use the same system?
You might be right, but then again, I think if they follow the usual FAQ
steps they're more likely to (a) get the right answer and (b) understand
the answer that they got.
> Try this:
Here we go. Any moment now we're going to see a shebang line without
a -w ...
> #!/usr/bin/perl
Give that usenaut a banana.
> print "Content-type: text/html\n\n";
> print qq~
I'm pretty sure a here-document is the preferred way of doing this.
I like the way you're explaining step by step each thing you changed,
why you did it, and where to learn more about the underlying principles.
------------------------------
Date: 15 Aug 1999 23:21:59 GMT
From: kisrael@andante.cs.tufts.edu (Kirk Is)
Subject: Rolling my own Newsreader
Message-Id: <7p7i2n$rju$1@news3.tufts.edu>
I'm wanting to roll my own newsreader, masochist that I am.
At first, I want to make it as a supplement to tin: I want a program that
I can easily see a list of all newgroups I'm subscribed to with a count of
how many unread articles are there in threads I've been involved in. (I'm
relying on subject lines, not threading proper, at least to start with.)
Two questions:
Is there a "trivial" way of parsing .newsrc file lines? It records
unread article #s in a descriptive format:
e.g. 1-103,105-110,112,115-200 , etc.
I assume I want to map this to an array. I know enough perl to do this
using a counter, splitting on commas, and then using for loops and what
not, but I was wondering there was an easier way of initializing the
arrays than this. (And also, dumping the array back to this format.)
Is there anything in the NNTP library to grab headers en masse? It takes
a long time to grab every header from the meatier newsgroups one by one,
so I suspect that's not what tin is doing everytime I open a newsgroup.
On the other hand, it doesn't seem to be caching the header information
anywhere, (at least not between sessions in the .tin directory) But I
don't think tin can successfully thread without downloading all the
headers.
The first question is very Perlish, but i understand the second might not
be, except that it deals with the NNTP module. Pointers to more
appropriate groups are welcome as well as fresh information.
--
Kirk Israel - kisrael@cs.tufts.edu - http://www.alienbill.com
"Morality's lease is up and Science has the keys to the apartment."
-Ander's Mad Scientist Page
------------------------------
Date: Mon, 16 Aug 1999 01:55:27 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Rolling my own Newsreader
Message-Id: <RqIt3.766$U36.4537@news1.online.no>
Kirk Is <kisrael@andante.cs.tufts.edu> wrote in message
news:7p7i2n$rju$1@news3.tufts.edu...
> Two questions:
> Is there a "trivial" way of parsing .newsrc file lines? It records
News::Newsrc is a good module for this
> unread article #s in a descriptive format:
> e.g. 1-103,105-110,112,115-200 , etc.
News::Newsrc uses the module Set::IntSpan to work with numbers in this
format.
> Is there anything in the NNTP library to grab headers en masse? It takes
> a long time to grab every header from the meatier newsgroups one by one,
> so I suspect that's not what tin is doing everytime I open a newsgroup.
Both Net::NNTP and News::NNTPClient supports the NNTP-command xover which
will return a
tab-separated list of headers, one message pr. line (or is it tab-delimited,
newline separated...?).
numb subj from date mesg refr char line xref
The format returned from xover depends on the newsserver. It can be
retrieved by using the NNTP-command "list overview.fmt"
list overview.fmt
215 Order of fields in overview database.
Subject:
From:
Date:
Message-ID:
References:
Bytes:
Lines:
Xref:full
.
--
Trond Michelsen
------------------------------
Date: 16 Aug 1999 00:34:02 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Things my math teacher forgot to tell me
Message-Id: <7p7m9q$d0$1@lublin.zrz.tu-berlin.de>
Abigail <abigail@delanet.com> wrote in comp.lang.perl.misc:
>Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMCLXXV September
>MCMXCIII in <URL:news:7p5h1s$v91$1@lublin.zrz.tu-berlin.de>:
[The Art of Computer Programming]
>?? work). Read the first few chapters, then use the index to jump
>?? to things that interest you.
>
>Uhm, Vol I of TAoCP only has 2 chapters...
Okay, what I meant to say is, read sequentially until you're
comfortable with Knuth's style and method of representation,
then use it as a reference. When I read a book, I'm rarely
aware what chapter I'm in.
Anno
------------------------------
Date: 15 Aug 1999 20:56:14 -0400
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Why use Python when we've got elisp? (was: Re: Why use Perl...)
Message-Id: <xlx3dxk35n5.fsf_-_@gold.cis.ohio-state.edu>
>>>>> On 14 Aug 1999 01:46:27 GMT,
sholden@pgrad.cs.usyd.edu.au (Sam Holden) said:
>> My version of VIM has Python embedded in it, so I can run Python
>> scripts in Vim. You, probably, would be happier compiling in Perl.
Sam> Or just using Vim ability to shell out. Thus reducing code bloat
Sam> for no benefit, and making upgrading perl/python effect your
Sam> editor which much less effort.
You're all a bunch of infidels. If you were using XEmacs, this would
be a solved problem, because you'd be using EFS.
:-)
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: Sun, 15 Aug 1999 19:22:42 +0100
From: Robin Becker <robin@jessikat.demon.co.uk>
Subject: Re: Why use Python when we've got Perl?
Message-Id: <kdmYUAAyVwt3EwoS@jessikat.demon.co.uk>
In article <37b9a99b.635832158@nntp.ix.netcom.com>, Michael Rubenstein
<miker3@ix.netcom.com> writes
...
>The problem in comp.lang.perl.misc is not the beginners -- it is
>the regulars.
A language bigot is a language bigot, I've invented crappy laguages, I'm
just not stupid/arrogant enough to proselytise.
--
Robin Becker
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 V9 Issue 547
*************************************