[18725] in Perl-Users-Digest
Perl-Users Digest, Issue: 893 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 14 06:05:55 2001
Date: Mon, 14 May 2001 03:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <989834708-v10-i893@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 14 May 2001 Volume: 10 Number: 893
Today's topics:
Re: [OT] Software Engineering at 14 (was: Re: Beginner' <reply-via@my-web-site.com>
Re: AND-connected search <bart.lateur@skynet.be>
Re: basic TRUE / FALSE <pne-news-20010514@newton.digitalspace.net>
Re: Cabal Guidelines for comp.lang.perl.misc ($Revision <bart.lateur@skynet.be>
Re: Cabal Guidelines for comp.lang.perl.misc ($Revision nobull@mail.com
create html-gif on the fly <marcl@xs4all.nl>
Re: criteria for bulit-in functions <pne-news-20010514@newton.digitalspace.net>
Re: DOS Perl convering LF to CR/LF <pne-news-20010514@newton.digitalspace.net>
form <edge3d@wanadoo.nl>
Re: Help with my html to txt perl script (Tad McClellan)
Re: Help with my html to txt perl script <pne-news-20010514@newton.digitalspace.net>
Re: HELP!!! Bus error(coredump) - How to recover? <goldbb2@earthlink.net>
Re: HELP!!! Bus error(coredump) - How to recover? <goldbb2@earthlink.net>
Re: HELP!!! Bus error(coredump) - How to recover? <johnlin@chttl.com.tw>
Re: HELP: loading a hash of anon subs from file... nobull@mail.com
Re: Http REFFERER -> IP ADDR <godzilla@stomp.stomp.tokyo>
Re: Http REFFERER -> IP ADDR <godzilla@stomp.stomp.tokyo>
Re: Http REFFERER -> IP ADDR (Dave Bailey)
Re: Http REFFERER -> IP ADDR <godzilla@stomp.stomp.tokyo>
Re: Http REFFERER -> IP ADDR (Dave Bailey)
Net::FTP and timeout ! HELP <bordas@jeuxvideo.com>
Newbie:Exporter problems <hmacdonald@europarl.eu.int>
Re: Newbie:Exporter problems nobull@mail.com
Re: Newbie:Exporter problems <hmacdonald@europarl.eu.int>
Re: perl jobs in sunny south florida (David H. Adler)
Re: Req. for help: need biometric guniea pigs <pne-news-20010514@newton.digitalspace.net>
Re: Segmentation fault (core dumped) <ubl@schaffhausen.de>
sorting <hpya78@postoffice.pacbell.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 14 May 2001 11:27:37 +0200
From: "Biep @ http://www.biep.org/" <reply-via@my-web-site.com>
Subject: Re: [OT] Software Engineering at 14 (was: Re: Beginner's Language?)
Message-Id: <9do8ad$imtpa$1@ID-63952.news.dfncis.de>
"FM" <danfm@dartmouth.edu> wrote in message
news:9dk70r$4gv$1@merrimack.Dartmouth.EDU...
> I don't think you'd have "general comprehensive education" by age
> 14 either. I don't know about other people, but I had been hardly
> taught anything in school by 14 beyond a few misrepresented facts.
Well, someone with a good education will probably know more "school stuff"
by the age of 14 than many others will learn at all.
What is lacking will be life experience, a sense of scientific humility,
and a good sense of what life is really about.
I don't think I have had a particularly good education, but at 14 I had a
good basis of the three Rs, basic grammar, a working knowledge of a few
foreign languages, roughly the same amount of historic and geographic
knowledge that I have now (those were out of vogue at that time), and
decent introductions in physics, math, and biology. (Chemistry came
later.) Culture history had been good, arts and crafts, like physical
education, simply didn't have my attention. (Still, I was a decent
swimmer.)
My real problem with strong specialisation that early would be the lack of
insight in the goals of life.
Follow-ups set to misc.education
--
Biep
Reply via http://www.biep.org
------------------------------
Date: Mon, 14 May 2001 09:54:03 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: AND-connected search
Message-Id: <7javfts9oco3brbb3o0krvg89p6dr4pep3@4ax.com>
Tim Lauterborn wrote:
>I am looking for a regular expression which allows a sort of
>AND-connected-search like in the following code example which unfortunately
>does not work.
>
>$line="acd";
>print ($line=~/a&&c/);
/a/ && /c/
From your other post, I gather that you want tocreate such a search on
the fly, from user data. eval to the rescue!
$searchsub = eval 'sub { ' .
join(' && ', map "/$_/", @searchterm) .
'};';
You'll have to take care of properly handling special characters in the
searchterms. For example, for literal searches, you can use "/\Q$_/" for
the map expression.
--
Bart.
------------------------------
Date: Mon, 14 May 2001 11:44:22 +0200
From: Philip Newton <pne-news-20010514@newton.digitalspace.net>
Subject: Re: basic TRUE / FALSE
Message-Id: <n6avft0lis42dq6oatuu8jt05eacfvufq1@4ax.com>
On Sat, 12 May 2001 14:04:38 +0200, eins@durchnull.de (Rudolf Polzer)
wrote:
> Even in C++, a comparison with true is wrong since
>
> 2 = true
>
> returns false.
I think it returns nothing because your program will not compile.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Mon, 14 May 2001 08:53:33 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Cabal Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <r97vftggfdf5ulmeuqlu5nv3j2a9rci18k@4ax.com>
Uri Guttman wrote:
> LM> <godzilla@stomp.stomp.tokyo> wrote wonderful things about sparkplugs:
>
> >> Shall I address you as Lou Moran, Anno Siegel or
> >> by your moniker, nobull? What is your preference?
> >> Would you rather I address you by another of your
> >> myriad fake personalities, perhaps as Ms. Mueller?
>this is one of moronzilla's most bizarre delusions, that most (if not
>all) of the regular posters here are a single person
And YAPC is just one person having a bit of fun all on his own.
--
Bart.
------------------------------
Date: 14 May 2001 08:31:12 +0100
From: nobull@mail.com
Subject: Re: Cabal Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <u9y9s0s30k.fsf@wcl-l.bham.ac.uk>
Bart Lateur <bart.lateur@skynet.be> writes:
> Uri Guttman wrote:
>
> > LM> <godzilla@stomp.stomp.tokyo> wrote wonderful things about sparkplugs:
> >
> > >> Shall I address you as Lou Moran, Anno Siegel or
> > >> by your moniker, nobull? What is your preference?
> > >> Would you rather I address you by another of your
> > >> myriad fake personalities, perhaps as Ms. Mueller?
>
> >this is one of moronzilla's most bizarre delusions, that most (if not
> >all) of the regular posters here are a single person
>
> And YAPC is just one person having a bit of fun all on his own.
Perhaps Kira should be invited to present an "alternative keynote" at
YAPC. We could bill her as "Godzilla, the David Icke[1,2,3] of Perl".
[1] http://www.davidicke.com/
[2] I live in the UK Midlands where we remember David Icke as local TV
news sports anchor before he turned prophet.
[3] David believes the world is secretly run by cabal of alien
lizard-men, I wonder if Kira's moniker is a secret code?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 14 May 2001 09:04:11 +0200
From: "Marc Lambrichs" <marcl@xs4all.nl>
Subject: create html-gif on the fly
Message-Id: <9do031$rjr$1@news1.xs4all.nl>
I want to create a gif from an html-file on-the-fly. Is it possible?
--
Marc
------------------------------
Date: Mon, 14 May 2001 07:45:14 +0200
From: Philip Newton <pne-news-20010514@newton.digitalspace.net>
Subject: Re: criteria for bulit-in functions
Message-Id: <kvquftshm9648m5pobn9olkh5lpgoc1iel@4ax.com>
On Sun, 13 May 2001 01:40:31 +1000, "Gregory Toomey" <gtoomey@usa.net>
wrote:
> Certainly cp and mv would be very useful though.
For that you have File::Copy, no?
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Mon, 14 May 2001 07:22:43 +0200
From: Philip Newton <pne-news-20010514@newton.digitalspace.net>
Subject: Re: DOS Perl convering LF to CR/LF
Message-Id: <gnpuft0ohn5862s9mj7ejvu9lmmrh1cl13@4ax.com>
On 14 May 2001 01:47:37 GMT, gorilla@elaine.furryape.com (Alan Barclay)
wrote:
> In article <kldaft8qmicvt81nlo3v852egnt470bgbj@4ax.com>,
> Bart Lateur <bart.lateur@skynet.be> wrote:
> >As you noticed, "\n" is chr(10), just as in Unix. So it's just one
> >character, not two. Conversion from CRLF to "\n" happens on input, and
>
> \n is chr(13) on Macs. You can generalize that to \n is always the
> end of line character on text files.
More like (I think): 'if you read in a text file, lines will appear to
be terminated by "\n".'
On disk, they could be terminated "\015" (Mac), "\015\012" (DOS), "\012"
(Unix) -- or even unterminated but father fixed-length and space-padded
(some mainframes?). But I think that even in the latter case, Perl's I/O
abstracts that away and gives you the illusion that lines are terminated
by "\n"[1], regardless of whether "\n" eq "\015" or "\n" eq "\012" or
"\n" eq "{whatever it is in EBCDIC}".
Cheers,
Philip
[1] Though this would mean that you couldn't write spaces at the end of
a line and expect them still to be there when you read the file in
again.
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Mon, 14 May 2001 11:16:02 +0200
From: "Barry" <edge3d@wanadoo.nl>
Subject: form
Message-Id: <3affa1fd$0$19661@reader4>
I have made a mailingform with formmail.pl
When sending a message the script generates a standard content:
Below is the result of your feedback form. It was submitted by
(Barry) on Monday, May 14, 2001 at 11:12:57
--------------------------------------------------------------------------
message:
Submit: Send Message
--------------------------------------------------------------------------
I only want the message in the body and not the "Below is the result
of........."
How can I do this????
Thanx, Barry
------------------------------
Date: Sun, 13 May 2001 22:35:08 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Help with my html to txt perl script
Message-Id: <slrn9fuh2s.cjq.tadmc@tadmc26.august.net>
[ Please put your comments *following* the quoted text that you
are commenting on.
Please do not quote an entire article.
Please never quote .signatures.
Please see: http://www.geocities.com/nnqweb/nquote.html
Thanks.
Jeopardectomy performed.
]
newuser <newuser@nospam.slip.net> wrote:
>Tad McClellan wrote in message ...
>>newuser <newuser@nospam.slip.net> wrote:
>>Such questions are collected up into a document called a "FAQ"
>>(Frequently Asked Questions).
>>
>>You are expected to check there *before* posting to the newsgroup.
>>
>> perldoc -q HTML
>>
>> "How do I remove HTML from a string?"
>>>#treat as single line...
>>>$wholeFile =~ s/<[^>]*>//gs;
>> ^
>> ^
>>That option does not do anything with the pattern you have.
>>
>>The "s" option only affects dots in the pattern. You do not have
>>any dots in your pattern.
>Thanks Tad for your help and suggestions.
You're welcome. Please quote your posts properly in the future though.
>Do you happen to know where the
>site is
There is no "site" required. The Perl FAQs are copied to your hard
drive as part of a normal perl installation. You already have these
docs, no need to go "get" them.
Lemme try out my new "Intro to perldoc" paragraphs on you:
----------------------------------------------------------
The perl distribution includes documentation that is copied to your
hard drive when you install perl. Also installed is a program for
looking things up in that (and other) documentation named 'perldoc'.
You should either find out where the docs got installed on your
system, or use perldoc to find them for you. Type "perldoc perldoc"
to learn how to use perldoc itself. Type "perldoc perl" to start
reading Perl's standard documentation.
----------------------------------------------------------
>so I can find the faq perldoc -q HTML that you mention?
Get a command line on the machine where perl is installed. Type:
perldoc -q HTML
That's all there is to it.
>In regards to the s pattern you
>said,"This is only a pattern if you have a dot"
No I didn't! (and I cannot make any sense of what _your_ quote above means...)
Why attempt to paraphrase me and then get it wrong?
Why not just quote what I really said, as I have done above?
>but if your webpages has for
>example a baseball.html then would not this be a dot pattern.
That would not be "dot pattern". That would be a "dot string".
The "pattern" and the "string to be matched against" are not the
same thing.
The "pattern" is what you have written in your code. You did not
write any dots there.
The "s" does not do anything with your pattern. Remove the "s".
(though none of my comments will fix your problem. I cannot see
what your problem is.
)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 14 May 2001 07:45:15 +0200
From: Philip Newton <pne-news-20010514@newton.digitalspace.net>
Subject: Re: Help with my html to txt perl script
Message-Id: <4cruft04c4dn0ss5vdjs52f80s1u3ctud8@4ax.com>
On Sun, 13 May 2001 11:04:25 -0700, "newuser" <newuser@nospam.slip.net>
wrote:
> Do you happen to know where the
> site is so I can find the faq perldoc -q HTML that you mention?
If you install Perl on your own computer (recommended -- for example,
this way you can test scripts for syntax errors before putting them
somewhere else, and test scripts using CGI.pm in offline mode), then
'perldoc' should be installed, too. Just type
perldoc -q HTML
on the command line.
> In regards to the s pattern you
> said,"This is only a pattern if you have a dot" but if your webpages has for
> example a baseball.html then would not this be a dot pattern.
He was talking about this pattern:
$wholeFile =~ s/<[^>]*>//gs;
There is no '.' in the pattern there. The pattern is only
<[^>]*>
. Since the /s switch only affects patterns containing a '.', you can
leave it off here, since it serves no purpose.
Also, please put your responses *after* quoted text, and trim the quoted
text so that it only contains the passages you want to comment on.
Especially, please don't put the entire previous post (signature and
all) after your comments.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Mon, 14 May 2001 03:14:45 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: HELP!!! Bus error(coredump) - How to recover?
Message-Id: <3AFF85E5.EDB15EB0@earthlink.net>
John Lin wrote:
>
> More information, when I run with perl -d, I got
>
> $ perl -d GWftp.pl
> Default die handler restored.
>
> Loading DB routines from perl5db.pl version 1.07
> Editor support available.
>
> Enter h or `h h' for help, or `man perldebug' for more help.
>
> Signal BUS at /opt/perl5/lib/site_perl/5.6.0/Net/FTP.pm line 21
> Net::FTP::BEGIN('strict', 'Fcntl') called at /opt/perl5/lib/site_perl/50
> require 0 called at /opt/perl5/lib/site_perl/5.6.0/Net/Config.pm line 0
> require Net/FTP.pm called at GWftp.pl line 5
> main::BEGIN() called at /opt/perl5/lib/site_perl/5.6.0/Net/Config.pm li0
> require 0 called at /opt/perl5/lib/site_perl/5.6.0/Net/Config.pm line 0
> Abort(coredump)
What happens if you do
perl -MFcntl -e"print 1;"
or
perl -d -MFcntl -e"print 1;"
--
Customer: "I would like to try on that suit in the window."
Salesman: "Sorry sir, you will have to use the dressing room."
------------------------------
Date: Mon, 14 May 2001 03:15:21 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: HELP!!! Bus error(coredump) - How to recover?
Message-Id: <3AFF8609.B23F4E33@earthlink.net>
John Lin wrote:
>
> Thank you for responding.
>
> "Einhardschule Seligenstadt" wrote
> > What happens on
> > perl -MNet::FTP -e"print 1;"
>
> Running by super-user is OK, but running by normal user fails.
>
> $ perl -MNet::FTP -e "print 1"
> Bus error(coredump)
>
> $ su root
> $ perl -MNet::FTP -e "print 1"
> 1
Seeing this, I get the impression that some file [perhaps a .so] is readable by root, but not by the user. But that's just a guess.
> > If it crashes, try to download Net::FTP from the CPAN (again).
>
> Yes, we did. During the installation (running by super-user), the
> perl Makefile.PL
> make
> phases are all OK. But the
> make test
> phase fails. All tests dump a core. Wow!!!
>
> # perl Makefile.PL
> <snip all OK messages>
> # make
> <snip all OK messages>
> # make test
> PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/opt/perl5/lib/ 5.6.0/PA-RISC2.0 -I/opt/perl5/lib/5.6.0 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
> t/ftp...............dubious
> Test returned status 0 (wstat 138, 0x8a)
> test program seems to have generated a core
[snip of other 5 failures]
> FAILED--6 test scripts could be run, alas--no output ever seen
> *** Error exit code 2
Where exactly do each of these tests fail?
--
Customer: "I would like to try on that suit in the window."
Salesman: "Sorry sir, you will have to use the dressing room."
------------------------------
Date: Mon, 14 May 2001 16:27:10 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: HELP!!! Bus error(coredump) - How to recover?
Message-Id: <9do4op$qg4@netnews.hinet.net>
"Benjamin Goldberg" wrote:
> John Lin wrote:
> > "Einhardschule Seligenstadt" wrote
> > > What happens on
> > > perl -MNet::FTP -e"print 1;"
> > Running by super-user is OK, but running by normal user fails.
> > # make test
> > Test returned status 0 (wstat 138, 0x8a)
> > test program seems to have generated a core
> [snip of other 5 failures]
> > FAILED--6 test scripts could be run, alas--no output ever seen
> > *** Error exit code 2
> Where exactly do each of these tests fail?
Gee, I am terribly sorry.
I really appreciate all your help. But our system administrator claimed
that he has fixed it. He said the problem was "shadow password".
When he removed the "shadow password" functionality, it became OK.
I don't really understand, but the "testing spot" is gone, thus we can
no longer do any experiment on it.
I think I lost a chance to learn something here...
Thank you very much again.
John Lin
------------------------------
Date: 14 May 2001 08:51:11 +0100
From: nobull@mail.com
Subject: Re: HELP: loading a hash of anon subs from file...
Message-Id: <u91ypstirb.fsf@wcl-l.bham.ac.uk>
bboett@erm6.u-strasbg.fr (Bruno Boettcher) writes:
> i am in the progress of writing an irc bot in perl, since it has to
> answer to a lot of triggers, i put the triggers into a hash with
> references to anon subroutines, like this:
>
> 'PART' => sub
> {
> my $sLine = shift;
> $sLine =~ s/:(.*)$/$1/;
> ... and some more code ....
> },
>
> 'JOIN' => sub
> {
> ... even more code ...
> }
>
> and then in the event loop i make :
> &{$reactions->{$commandtag}}( $sLine, $sGtmp );
You can make the above neater using the -> syntax:
$reactions->{$commandtag}->( $sLine, $sGtmp );
> now this works fine, but now i thought, that it would be nice to have
> those triggers outside of the main file. That way i would be able to
> modify the behaviour of the bot without needing to restart it, only
> issue a reload command ...
>
> so i put all the lines of the hash into a ':' separated file.
Why? Why not simply leave the file in original Perl syntax and just
do() it?
%$reactions = do 'config_file';
> Loaded that file into the hash, but when i try to use the subs, i
> get the following error: Can't use string ("sub { SendServer(
> 'PRIVMSG '.$se") as a subroutine ref while "strict refs" in use at
> ./zebot.pl line 398, <GEN1> line 34.
Looks like you forgot to compile the subroutines. To convert the
string 'sub { 1 }' into a coderef you must pass it through the eval()
function.
I still think do() would be better.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Sun, 13 May 2001 22:43:07 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Http REFFERER -> IP ADDR
Message-Id: <3AFF706B.9F4181FD@stomp.stomp.tokyo>
Dave Bailey wrote:
> Godzilla! wrote:
> >Ian Knight wrote:
(snipped some coding humor with a sly grin)
> > All appears normal, but is not. If you
> > work on learning why this happens, you
> > will benefit by gained knowledge about
> > something, of which, few know.
> ...I cannot emphasize enough how much you stand to gain from
> learning how to use regular expressions to do pattern matching....
> Instead of continually trying to force index and substr to work in
> situations naturally suited to regular expressions, make an effort
> to learn what regular expressions are and how to use them.
My goodness, you do seem a bit irritable lately.
Is it my staunch support of USENET traditions
and customs which agitate you so?
So tell me, what have you learned lately?
Godzilla!
------------------------------
Date: Sun, 13 May 2001 23:37:26 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Http REFFERER -> IP ADDR
Message-Id: <3AFF7D26.7F85F2DB@stomp.stomp.tokyo>
Dave Bailey wrote:
> Godzilla! wrote:
> >Ian Knight wrote:
(significantly snipped)
> ...I cannot emphasize enough how much you stand to gain from
> learning how to use regular expressions to do pattern matching.
> For example:
(snipped array)
> foreach ( @Array ) {
> if ( m!(https?|news)://([^\s/]+)! ) {
> my $a = inet_aton($2);
> print inet_ntoa($a), "\n" if $a;
> }
> }
> Instead of continually trying to force index and substr to work in
> situations naturally suited to regular expressions, make an effort
> to learn what regular expressions are and how to use them.
Well, I have a hunch you will not enjoy this and,
perhaps will lead you to toss another temper tantrum.
My code methodology is significantly more efficient
than is your code methodology, just a bit shy of being
twice as efficient as yours, even with adding code to
mine which is not needed, to play fair. I mean, I am
firm but fair, you know.
Which of us needs to learn?
Godzilla!
--
#!perl
print "Content-type: text/plain\n\n";
use Benchmark;
print "Run One:\n\n";
&Time;
print "\n\nRun Two:\n\n";
&Time;
print "\n\nRun Three:\n\n";
&Time;
sub Time
{
timethese (100000,
{
'name1' =>
'@Array = qw (http://search.lycos.com/raf/default.asp
http://ph.lycosasia.com/srch/more.html
http://www.altavista.com/iepane?A&Query+String&Here
http://buscador.ya.com/scripts/bavanzada
http://groups.google.com/groups
http://la.znet.com/~callgirl/rockmusi.html
news://news.ttnet.net.tr/
news://news.fh-flensburg.de/);
foreach $hostname (@Array)
{
$hostname = substr ($hostname, 7, index ($hostname, "/", 7) - 7);
$a = "true";
}',
'name2' =>
'@Array = qw (http://search.lycos.com/raf/default.asp
http://ph.lycosasia.com/srch/more.html
http://www.altavista.com/iepane?A&Query+String&Here
http://buscador.ya.com/scripts/bavanzada
http://groups.google.com/groups
http://la.znet.com/~callgirl/rockmusi.html
news://news.ttnet.net.tr/
news://news.fh-flensburg.de/);
foreach ( @Array )
{
if ( m!(https?|news)://([^\s/]+)! )
{ my $a = "true"; }
}',
} );
}
exit;
PRINTED RESULTS:
________________
Run One:
Benchmark: timing 100000 iterations of name1, name2...
name1: 4 wallclock secs ( 4.23 usr + 0.00 sys = 4.23 CPU) @ 23640.66/s
name2: 7 wallclock secs ( 6.76 usr + 0.00 sys = 6.76 CPU) @ 14792.90/s
Run Two:
Benchmark: timing 100000 iterations of name1, name2...
name1: 5 wallclock secs ( 4.28 usr + 0.00 sys = 4.28 CPU) @ 23364.49/s
name2: 7 wallclock secs ( 6.81 usr + 0.00 sys = 6.81 CPU) @ 14684.29/s
Run Three:
Benchmark: timing 100000 iterations of name1, name2...
name1: 4 wallclock secs ( 4.29 usr + 0.00 sys = 4.29 CPU) @ 23310.02/s
name2: 7 wallclock secs ( 6.75 usr + 0.00 sys = 6.75 CPU) @ 14814.81/s
------------------------------
Date: 14 May 2001 08:04:53 GMT
From: dave@sydney.daveb.net (Dave Bailey)
Subject: Re: Http REFFERER -> IP ADDR
Message-Id: <slrn9fuq5b.f0p.dave@sydney.daveb.net>
On Sun, 13 May 2001 23:37:26 -0700, Godzilla!
<godzilla@stomp.stomp.tokyo> wrote:
>Dave Bailey wrote:
[...]
>> Instead of continually trying to force index and substr to work in
>> situations naturally suited to regular expressions, make an effort
>> to learn what regular expressions are and how to use them.
[...]
>My code methodology is significantly more efficient
>than is your code methodology...
[...]
Your code is broken. Broken code is decidedly less efficient than
working code. I'm amused that you went to the trouble to benchmark
it, though. By the way, were these trailing slashes in your referer
logs:
> news://news.ttnet.net.tr/
> news://news.fh-flensburg.de/
Or did you add them because you couldn't figure out how to fix your
code, since you don't know what a regular expression is?
--
Dave Bailey
davidb54@yahoo.com
------------------------------
Date: Mon, 14 May 2001 01:45:43 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Http REFFERER -> IP ADDR
Message-Id: <3AFF9B37.28AD7C32@stomp.stomp.tokyo>
Dave Bailey wrote:
> Godzilla! wrote:
> > Dave Bailey wrote:
(snipped)
> Your code is broken. Broken code is decidedly less efficient than
> working code. I'm amused that you went to the trouble to benchmark
> it, though. By the way, were these trailing slashes in your referer
> logs:
> > news://news.ttnet.net.tr/
> > news://news.fh-flensburg.de/
Back for more, eh? You little boys never learn.
I just knew you would toss a temper tantrum!
Had a hunch you would tell more of your
constant lies, which are, as I told you
before, most impotent.
I can tell you have no sense of humor and,
certainly are not a Sherlock Holmes.
> Or did you add them because you couldn't figure out how to fix your
> code, since you don't know what a regular expression is?
Well, I know enough about regex methods to not use yours,
it is very inefficient, but, well, would you mind if I improve
your regex? Oh goodie! I didn't think you would.
m!//([^\s/]+)!
Isn't that pretty!! Sure a lot better now! Faster to boot!
Which of us needs to learn?
Ya know, lately you have been very annoying, very insulting
and deliberately trolling me. I shall stomp stomp you! In
time, a lot of time, maybe never, you will realize "https"
will cop a bug in my code. Well, truthfully, I was going
to wait until you pitch a hissy fit to do this, except
you are such a screaming arsehole, STOMP! STOMP!
$hostname = substr ($hostname, index ($hostname, "//") + 2,
index ($hostname, "/", 8) -
index ($hostname, "//") - 2);
Still more efficient than your regex method even
after I fixed your regex!
**
Brass Tacks is this. My original article was written both
to entertain and to inspire the originating author to
research substring methods by figuring out what was
wrong with my code. This is made clear by my wording.
However, it only takes one cowardly school yard bully
like you, a King of the Sandbox spoil sport like you,
to ruin any enjoyment people may have here. Annoyingly,
almost all of you boys are like you; hateful.
Think of me as the person who pisses in your sandbox.
Godzilla!
------------------------------
Date: 14 May 2001 09:52:47 GMT
From: dave@sydney.daveb.net (Dave Bailey)
Subject: Re: Http REFFERER -> IP ADDR
Message-Id: <slrn9fv0fk.mak.dave@sydney.daveb.net>
On Mon, 14 May 2001 01:45:43 -0700, Godzilla!
<godzilla@stomp.stomp.tokyo> wrote:
>Dave Bailey wrote:
[...]
>> Or did you add them because you couldn't figure out how to fix your
>> code, since you don't know what a regular expression is?
>Well, I know enough about regex methods to not use yours,
>it is very inefficient, but, well, would you mind if I improve
>your regex? Oh goodie! I didn't think you would.
>
>m!//([^\s/]+)!
>
>Isn't that pretty!! Sure a lot better now! Faster to boot!
This breaks if the referer is a file URI. Unacceptable.
>Which of us needs to learn?
You do. Do you know what an RFC is? Read RFC 2616, section 14.36.
Then read RFC 1630 - all of it.
>Ya know, lately you have been very annoying, very insulting
>and deliberately trolling me.
You are describing yourself. All I do is point out your mistakes and,
when I have the time, correct them. I am doing you a favor. It's not
my fault if everything you post is wrong and you refuse to learn from
your incessant mistakes.
>Brass Tacks is this. My original article was written both
>to entertain and to inspire the originating author to
>research substring methods by figuring out what was
>wrong with my code. This is made clear by my wording.
Nothing is ever made clear by your wording save for the fact that you
have absolutely no idea what you are doing. You invite and deserve
the treatment you get on this newsgroup, and you will continue to get
more of the same until you shut your mouth and start learning.
--
Dave Bailey
davidb54@yahoo.com
------------------------------
Date: Mon, 14 May 2001 10:14:23 +0200
From: "David Bordas" <bordas@jeuxvideo.com>
Subject: Net::FTP and timeout ! HELP
Message-Id: <3aff8c59@feednews.internext.fr>
Hi all,
I'm using Net::FTP since several months.
And all works fine.
But a few days ago we have moved from sun servers to linux redhat 6.2
servers.
And my script doesn't work now :(
Here is my code :
$ftp = Net::FTP->new("$host",Timeout => '20') || die "can't connect" ;
$ftp->login("anonymous",'mon@adresse.mail')|| die "can't log ";
$siz=$ftp->size("$fic");
$buf=$ftp->code;
$ftp->quit;
print "code ".$code;
And the problem is that i can't specify a timeout.
<< Timeout => '20' >>
would be 20 sec but in fact the timeout is allways of 750 secs :(
Can someone help me please
David
------------------------------
Date: Mon, 14 May 2001 10:08:19 +0200
From: harry macdonald <hmacdonald@europarl.eu.int>
Subject: Newbie:Exporter problems
Message-Id: <3AFF9273.E302464A@europarl.eu.int>
Hi,
I'm simply trying to export a variable.
The package code is the following :-
package xx;
$VERSION = 1.00;
my $title = WC;
require Exporter;
@ISA=('Exporter');
@EXPORT_OK=qw($title);
The program code is as follows :-
#!/bin/perl.exe
use strict;
use xx qw(:DEFAULT);
printf "title=$title");
The result is :-
Global symbol "$title" requires explicit package name
------------------------------
Date: 14 May 2001 08:43:31 +0100
From: nobull@mail.com
Subject: Re: Newbie:Exporter problems
Message-Id: <u94ruotjo0.fsf@wcl-l.bham.ac.uk>
harry macdonald <hmacdonald@europarl.eu.int> writes:
> The package code is the following :-
> @EXPORT_OK=qw($title);
^^^^^^^^
> The program code is as follows :-
> use xx qw(:DEFAULT);
^^^^^^^^
> printf "title=$title");
You have not defined any symbols that are to be exported by your
package by default, only ones that it is OK to export.
To define symbols that are exported by default set the @EXPORT package
variable.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 14 May 2001 11:57:03 +0200
From: harry macdonald <hmacdonald@europarl.eu.int>
Subject: Re: Newbie:Exporter problems
Message-Id: <3AFFABEF.28FED968@europarl.eu.int>
nobull@mail.com wrote:
> harry macdonald <hmacdonald@europarl.eu.int> writes:
>
> > The package code is the following :-
>
> > @EXPORT_OK=qw($title);
> ^^^^^^^^
>
> > The program code is as follows :-
>
> > use xx qw(:DEFAULT);
> ^^^^^^^^
> > printf "title=$title";
>
> You have not defined any symbols that are to be exported by your
> package by default, only ones that it is OK to export.
>
> To define symbols that are exported by default set the @EXPORT package
> variable.
> --------------------------------------------------
Great - The symbol $title is now exported into the program.
But the value is not !!
How can I get the value (set in the package) into the variable seen by the
program ?
I changed the package :-
package xx;
$VERSION = 1.00;
my $title = "something";
require Exporter;
@ISA=('Exporter');
@EXPORT=qw($title);
The program contains :-
#!/bin/perl.exe
use strict;
use xx qw(:DEFAULT );
printf "title=$title";
The resultant output is
title=
------------------------------
Date: 14 May 2001 06:50:28 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: perl jobs in sunny south florida
Message-Id: <slrn9fv01k.4c0.dha@panix2.panix.com>
In article <9dhkrp$q66$1@slb0.atl.mindspring.net>, Todd Katcher wrote:
> We are looking for several senior perl programmers to fill permanent
You have posted a job posting or a resume in a technical group.
Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.
Had you read and understood the Usenet user manual posted frequently to
"news.announce.newusers", you might have already known this. :) (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)
Another good source of information on how Usenet functions is
news.newusers.questions (information from which is also available at
http://www.geocities.com/nnqweb/).
Please do not explain your posting by saying "but I saw other job
postings here". Just because one person jumps off a bridge, doesn't
mean everyone does. Those postings are also in error, and I've
probably already notified them as well.
If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.
http://jobs.perl.org may be of more use to you
Yours for a better usenet,
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"If it's not Jewish, it's CRAP!:)" - IsraelBeta on #DWC
------------------------------
Date: Mon, 14 May 2001 07:45:15 +0200
From: Philip Newton <pne-news-20010514@newton.digitalspace.net>
Subject: Re: Req. for help: need biometric guniea pigs
Message-Id: <nlruftsnif3l7pvnj4mjdalqtdlg3idbr3@4ax.com>
On 13 May 2001 21:42:51 -0500, logan@cs.utexas.edu (Logan Shaw) wrote:
> In article <CAGL6.7$F21.2158@vic.nntp.telstra.net>,
> Wyzelli <wyzelli@yahoo.com> wrote:
> >"Mike Schiraldi" <mgs21@columbia.edu> wrote in message
> >news:Pine.GSO.4.10.10105131644070.2204-100000@aloha.cc.columbia.edu...
> >>
> >> my $PHRASE = "The quick brown fox";
> >
> >Shouldn't you use the full phrase "The quick brown fox jumped over the lazy
> >dog"? It is generally used since it contains each letter of the alphabet at
> >least once.
>
> Except "s", which is why the sentence actually used is "The quick brown
> fox jumps over the lazy dog."
Well, since we're nitpicking, I prefer "The quick brown fox jumps over a
lazy dog", which is two letters shorter. Or "Jackdaws love my big sphinx
of quartz".
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Mon, 14 May 2001 11:15:45 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Segmentation fault (core dumped)
Message-Id: <3AFFB050.31C28BA2@schaffhausen.de>
reader of news schrieb:
>
> I've figured it out.
>
> wrong sql statment is the culprit.
> die $dbh->errstr did not work.
I'd be interested in a more thorough description of your problem.
I once had such a problem with DBI and I never found a solution -
had no choice but going back to a backup without the core dump.
Thanx,
->malte
------------------------------
Date: Mon, 14 May 2001 01:17:20 -0700
From: Peter White <hpya78@postoffice.pacbell.net>
Subject: sorting
Message-Id: <3AFF948F.C69037C9@postoffice.pacbell.net>
Hello:
How to computes the standard deviation for the middle 60% of the scores?
FILE:
Peter 60 80 62
Tom 99 50 36
Mary 50 75 20
#!/user/bin/perl -w
$stddev=StandardDevation("fn.txt");
sub StandDeviation
{
my($file) =@_;
my($sum, $deviation, $name) =(0,0,"");
my(@all, @scores, $scoreline, $score,$average);
open(FILE, $file) || return -1;
foreach $scoreline(<F>)
{
($anme, @scores) = split /\s+/, $scorelines;
push(@all, @scores);
foreach $score(@scores)
{
$sum += $scores)
}
}
close (F);
$average = $sum/@all;
foreach $score(@all)
{
$deviation += ($average = $score) ** 2;
}
return sqrt($deviations/(@all-1));
}
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 893
**************************************