[16895] in Perl-Users-Digest
Perl-Users Digest, Issue: 4307 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 13 00:10:30 2000
Date: Tue, 12 Sep 2000 21:10:15 -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: <968818215-v9-i4307@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 12 Sep 2000 Volume: 9 Number: 4307
Today's topics:
Re: min function (Damian Conway)
Re: Perl vs. Java or C++ (Tim Hammerquist)
Perl Websites and Searching Results <conor@peoplewholikewine.com>
Re: Perl Websites and Searching Results <elephant@squirrelgroup.com>
Re: Qualifications for new Perl programmer????? <nospam@david-steuber.com>
Reply to Abi's sheep <nothing here! complain about that!!!>
Re: Reply to Abi's sheep <elephant@squirrelgroup.com>
Re: Reply to Abi's sheep (Gwyn Judd)
Re: Reply to Abi's sheep (Jim Seymour)
Re: Resolving IP's Q: Does this IP actually exist? (David Efflandt)
Re: returning a tied variable <rick.delaney@home.com>
Re: Silly grep tricks <anmcguire@ce.mediaone.net>
re: sqlplus and perl jhouriha@hotmail.com
Re: Where Doesn't this work? <All@n.Due.net>
Re: Where Doesn't this work? <anmcguire@ce.mediaone.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Sep 2000 01:29:54 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: min function
Message-Id: <8pmlai$jr$1@towncrier.cc.monash.edu.au>
Shawn Ribordy <Ribordy_Shawn_C@cat.com> writes:
> I have looked all over the place, and I cannot find a min function.
> Can anyone help?
use builtin 'min';
Damian
------------------------------
Date: Wed, 13 Sep 2000 01:29:36 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Perl vs. Java or C++
Message-Id: <slrn8rtmrt.1t1.tim@degree.ath.cx>
Chris Stith <mischief@motion.net> wrote:
> (I'm still considering learning Ruby and Python, just for
> the reason that I stated earlier about knowledge of more languages makes you
> an all-round better programmer.)
I resisted Python, but eventually enough people have mentioned it and
respected it as a useful, powerful language (with no threat of nudging
Perl aside. I've been looking at it for about 2 weeks now and I like
it. It's a very nice language with potential, but it's not Perl!
--
-Tim Hammerquist <timmy@cpan.org>
Intellectual brilliance is no guarantee against being dead wrong.
-- David Fasold
------------------------------
Date: Wed, 13 Sep 2000 03:42:30 +0100
From: "Conor at PeopleWhoLikeWine.com" <conor@peoplewholikewine.com>
Subject: Perl Websites and Searching Results
Message-Id: <39bee9ac.256ed@nancy.pacific.net.au>
Hi,
anyone care to comment on this one!
we are having a discussion about the cons of using Perl generated pages
on our website, because of the loss of search hits from search engines
compared
to static pages, and which site designs get the best hits from search
engines
once you start to use more and more perl generated pages...
1. what search engines ignore perl / .pl pages?
2. what site design produces the best search results for a site using MOSTLY
perl
generated pages?
for 2., we reckon put some static "placeholders" on your site, i.e. static
pages containing key index terms for search engines that will get you
indexed, and link off these to your MAIN pages, which are generated by perl.
I know this problem could actually apply to ANY dynamically generated
website, but we
are specifically using PERL and are unsure of (1) above...
in advance,
C.
------------------------------
Date: Wed, 13 Sep 2000 14:18:06 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Perl Websites and Searching Results
Message-Id: <MPG.14298ee8c0a290aa98979e@localhost>
Conor at PeopleWhoLikeWine.com <conor@peoplewholikewine.com> wrote ..
>anyone care to comment on this one!
>
>we are having a discussion about the cons of using Perl generated pages
>on our website, because of the loss of search hits from search engines
>compared to static pages, and which site designs get the best hits
>from search engines once you start to use more and more perl generated
>pages...
>
>1. what search engines ignore perl / .pl pages?
if there are any engines that ignore .pl extensions then you could
easily subvert them by mapping a different extension (eg. .html) in your
web server (which is why I say -if- .. because it'd be a pretty silly
idea because it's so easy to subvert)
you could also very simply pre-generate the static pages (eg. nightly -
or whenever the data is changed that you're filling the pages with) ..
this has an added performance benefit
>I know this problem could actually apply to ANY dynamically generated
>website, but we are specifically using PERL and are unsure of (1)
>above...
doesn't really make it on topic .. but you get an answer anyway
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Wed, 13 Sep 2000 04:01:42 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <m3k8chszxh.fsf@solo.david-steuber.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:
' Clearly I am not hiring and, these are rhetorical musings.
Fine, I don't mind a little sparing. I'll keep it friendly.
' No, you would not work for me. Perl 5.6 is the most buggy,
' error prone and unreliable version of Perl released to date.
' It is a version which should never be used for anything more
' than a home system and learning how to deal with problems.
Well, so far, my code will work just as well with 5.005. All my
documentation that is in print is for that version anyway.
' Strict indicates a reduced ability to write relatively error
' free programs and, indicates a reduced ability to debug a
' program without artificial assistance.
Not at all. I'm from C++. I am used to strict type checking
languages. I have no problem with no strict type checking, but I do
have a problem with typos. Strict is an excelent check against
typos.
' Modules tell me you are a copy and paste specialist rather
' than a talented programmer who can write programs sans
' a need for modules.
While I am happy to rebuild a wheel if the existing wheels don't suit
me, I will use existing code that I like. That applies to modules.
If a module provides the functionality I need and reduces the amount
of work I have to do, then I will bloody well use the modules.
' Your use of "LOC" indicates a diminished ability in effective
' communication. I have no clue what this means and, many others
' would have no clue. Hmm.. LOC, Lots Of Crap? Loser On Computer?
Lines Of Code. A common metric that is often misused as a metric of
productivity. However, I feel that the research that indicates that
the number of lines of code in a program is an indicator of
development time and chances for bugs is likely to be correct. Fewer
lines of code means, in general, less development time and less
opertunities for bugs to rear their ugly heads.
' Anyhow, a true test of programming skills would be to comply
' with my original qualifications; actually write a program
' sans copy and paste techniques. This sorts real programmers
' from copy and paste specialists.
I suppose if you were specifying a C++ test, you would like people to
avoid use of the Standard C++ libraries. After all, that is code
reuse, and copy and paste is the oldest form of code reuse there is.
As I said, I am not unwilling to rebuild a wheel from scratch. But I
only do that when existing wheels don't fit. The whole point of open
source software and libraries is to take advantage of the work of
others. Others that may have more talent than I do when it comes to
programming. Anything that makes me more productive is most welcome.
' > Happiness is a SAAB Gripen <http://www.gripen.saab.se/> in the
' > garage, an FN-FAL in the safe, and an HK P7M8 on the hip.
'
' Happiness is a classic Corvette Mako Shark, a 9mm Beretta in
' your personal valice and, rocking n rolling with a Colt AR-15,
' all of which I have, along with happiness. =)
I'll give you the Corvette. But I like the way the HK fits my hand.
Normally, I prefer a Colt CCO in .45 ACP, but the HK just plain works
better and hits what I point at out to 75' no problem. Not that I
would give up the Colt for anyone.
As for rock'n'roll, that makes it an M-16, not an AR-15. I like the
AR. Great gun, and I have a suppressor for it. The FAL can't be
suppressed because of the gas regulator. But it has the 7.62 Nato
caliber to punch through hard targets. I also like the way it
handles. Mind you, the 5.56mm NATO is cheaper to shoot and with the
suppressor, it is kinder to the neighbors.
As for the SAAB, that is just one awesome jet fighter. Small, cheap
to opperate (by military standards) and totally modern. Not to
mention sexy as all get out. You can't argue with that.
--
David Steuber | "Are you now, or have you ever been, a member
NRA Member | of the NRA?" --- HUAC, 2004
Happiness is a SAAB Gripen <http://www.gripen.saab.se/> in the
garage, an FN-FAL in the safe, and an HK P7M8 on the hip.
------------------------------
Date: Tue, 12 Sep 2000 18:58:09 -0700
From: "Someperson" <nothing here! complain about that!!!>
Subject: Reply to Abi's sheep
Message-Id: <srtmtqn9ct684@news.supernews.com>
Bleat! Baaaa!
"I have noticed that people in CLPM can be a bit abrupt sometimes, but
after reading your post I understand them a lot better."
Who made the first shot? I posed an innocent question. I don't lurk here.
Smartass could have just ignored my question but felt she had to make an
example of me. After watching the group I can see that the prime concern
around here is to make people feel stupid for not RTFM. Well, sorry. It
won't happen again. I made a mistake by just blindly coming here and
posting that question.
"So you can determine whether someone is a troll just from their domain.
You are my hero! Can you teach me how to do that?"
perldoc -v trolldomain
"bzzt - thanks for playing .. Abigail is one of the best contributors to
this forum - and you'd do well to heed her advice - for while it might
be a little caustic - it's accurate and would actually help you"
It didn't, actually. I didn't describe the situation in enough detail. But
that is entirely not the point. That no matter what I put now, it will be
attacked simply because I met a "caustic" reply with another one, is the
point.
"don't be an idiot .. put your tail between your legs and run along .. "
Oh FUCK you.
"Uncalled for. Her answer was correct and concise. We aren't paid to be
here so is it any wonder we sometimes like to have a joke at someone
else's expense, particularly when their question shows they haven't
bothered to a) read the documentation or b) read the newsgroup for a
while since this question is an FAQ. Score duly adjusted."
That "we aren't paid" part just kills me. Like Abi is some sort of martyr
for replying to my post in such a fashion.
And I have rarely come to this newsgroup. If you want to teach me a lesson
about reading the docs and FAQ, why don't you just put that. Having jokes
at someone elses expense is just ignorant when you have no clue what the
persons situation is. Not that it matters, I am now officially an
Asshole(TM) in this newsgroup for defending myself.
If it was such a stupid question, why didn't you just ignore it?? If I
hadn't got the answer, you know, I probably would have LOOKED IN THE MANUAL.
You get your result without belittling me.
"I was shocked! How could Someperson <nothinghere!complainaboutthat!!!>
say such a terrible thing"
Why did what I say, with zero knowledge of Abi personally, end up so
shocking and what she said is just par for the course? And yes, I *do*
have a wonderful Basset Hound named Abigail, because we all know the best
dog names go to Bassets. They deserve it. I hold my dog in very high
esteem!
Unlike you people.
------------------------------
Date: Wed, 13 Sep 2000 13:03:02 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Reply to Abi's sheep
Message-Id: <MPG.14297d4f9ffea78998979b@localhost>
"Someperson" <nothing here! complain about that!!!> <"Someperson"
<nothing here! complain about that!!!>> wrote ..
>"don't be an idiot .. put your tail between your legs and run along .. "
>
>Oh FUCK you.
now that really is against supernews policy .. thank you
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Wed, 13 Sep 2000 02:15:36 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Reply to Abi's sheep
Message-Id: <slrn8rtoq5.id4.tjla@thislove.dyndns.org>
I was shocked! How could Someperson <nothinghere!complainaboutthat!!!>
say such a terrible thing:
>Bleat! Baaaa!
<snip>
>That "we aren't paid" part just kills me. Like Abi is some sort of martyr
>for replying to my post in such a fashion.
Oh well, rest assured you won't have to worry about a number of people
in this group replying to your posts in any fashion again. Score
adjusted, this time more permanently.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Bill Gates is just a monocle and a persian cat away from being a villian
in a James Bond movie. (contributed by Randall Joiner)
------------------------------
Date: Wed, 13 Sep 2000 02:57:08 GMT
From: jseymour@LinxNet.com (Jim Seymour)
Subject: Re: Reply to Abi's sheep
Message-Id: <srtr847oct6155@corp.supernews.com>
In article <srtmtqn9ct684@news.supernews.com>,
"Someperson" <nothing here! complain about that!!!> writes:
[snip]
>
> Who made the first shot? I posed an innocent question. I don't lurk here.
[snip]
It apparently hasn't occurred to you that some of the folks who *do*
hang around here sometimes grow weary of seeing the same questions
asked over, and over, and over again, as nauseum, when the answers
are clearly presented in readily available documentation? Such as
the answer to yours was.
Just a thought.
(No, I'm not a "regular." But as with *any* newsgroup, I try to find
the answers in my library and by checking the Perl web sites and Deja
before asking here. It's just common courtesy.)
Regards,
Jim
--
Jim Seymour | PGP Public Key available at:
jseymour@LinxNet.com | http://www.cam.ac.uk.pgp.net/pgpnet/wwwkeys.html
http://home.msen.com/~jimsun | http://www.trustcenter.de/cgi-bin/SearchCert.cgi
------------------------------
Date: Wed, 13 Sep 2000 02:06:17 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Resolving IP's Q: Does this IP actually exist?
Message-Id: <slrn8rto8b.n32.efflandt@efflandt.xnet.com>
On 12 Sep 2000 12:59:57 -0400, David Wall <darkon@one.net> wrote:
>christopher_j@uswest.net (Christopher M. Jones) wrote in
><ZDrv5.71$Xt4.122011@news.uswest.net>:
>
>>
>>"David Wall" <darkon@one.net> wrote:
>>> ralawrence@my-deja.com (Richard Lawrence) wrote in
>>> <8pkrv8$s89$1@nnrp1.deja.com>:
>>> >Can anyone advise me if it is possible to find out whether a site
>>> >exists quickly and easily within a certain amount of alloted time? If
>>> >anyones solution doesn't require connecting to a port then thats fine,
>> ^^^^
>>> >because it means I can test first and then connect to the port
>>> >afterwards.
>>>
>>> How about Net::Ping?
>>
>>He needs to find if ports are open, you can't do that with
>>a simple ICMP ECHO (Ping) request.
>
>I never claimed you could. I was suggesting ping as a quick and easy way to
>see if a host exists and is reachable.
Ping would not work for our company smtp server and neither would
traceroute. I think ipchains is set to not answer ping so nobody can find
our box by pinging random IPs. But port 25 does answer if you know the
hostname or dsl IP.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Wed, 13 Sep 2000 02:42:57 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: returning a tied variable
Message-Id: <39BEEC3C.1B171E4A@home.com>
[posted & mailed]
Thom Harp wrote:
>
> What I'd *like* to do is something like:
>
> sub tie_variable {
> tie $foo, 'SomeClass';
> return $foo;
> }
>
> $bar = tie_variable;
You can't do it like that to my knowledge, since you are returning
tied($foo)->FETCH;
What exactly are you trying to do? Could you be satisfied with
sub tie_variable {
tie $_[0], 'Someclass';
}
tie_variable($bar);
?
That should be sufficient if you're just looking for a shortcut.
With appropriate prototypes this could work well for arrays and hashes
too. It also has the advantage of returning the tied object, in case
it's needed.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Tue, 12 Sep 2000 22:07:10 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: Silly grep tricks
Message-Id: <Pine.LNX.4.21.0009122204390.22782-100000@hawk.ce.mediaone.net>
On 12 Sep 2000, kj0 quoth:
k> Is there a way to get grep to return only the first item (if any) in a
k> list for which the test is true?
grep [options] PATTERN [FILE...] | head -1
springs to mind..
Regards,
anm
--
print map y="= = && $_ => <"\bJust> =>
=> <"Another> =>
=> <"Perl> =>
=> <"Hacker\n> =>
------------------------------
Date: Wed, 13 Sep 2000 02:43:55 GMT
From: jhouriha@hotmail.com
Subject: re: sqlplus and perl
Message-Id: <8pmpl7$6v4$1@nnrp1.deja.com>
how does one open up sqlplus
with system or exec or qw or a here document....
and do a shutdown immediate
I have tried the following below but have been unsucessful
I want to be able to shutdown an oracle instance from a perl script
my $user='internal';my $pass='manager';my $dsn='db.db.com';
$|=1;
system(
qq{
sqlplus -s<<EOF
$user/$pass\@$dsn
shutdown immediate
exit
<<EOF
my $user='internal';my $pass='manager';my $dsn='db.db.com'
my $sqlplus='sqlplus -s $user/$pass\@dsn;'
my $return_value=system($sqlplus);<<EOF
shutdown immediate
exit
<<EOF
print "system returned $return_value\n";
~
~
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 13 Sep 2000 01:25:39 GMT
From: Allan M. Due <All@n.Due.net>
Subject: Re: Where Doesn't this work?
Message-Id: <MPG.1428a116e266ecd3989685@news>
In article <39BEC5EF.F1F745D4@stomp.stomp.tokyo>,
godzilla@stomp.stomp.tokyo says...
|"Allan M. Due" wrote:
|
|> In article <#x4Y0BRHAHA.278@cpmsnbbsa07>, Cheng3@email.msn.com says...
Note:
Quote level 1: = cheng3 # I am quoting his message and I used the |
|> |Godzilla! <godzilla@stomp.stomp.tokyo> wrote in message
Quote 2;= Godzilla # Cheng3 quoting you. He used the >
|> |> $/ = "";
|> |>
|> |> open (FILEHANDLE, "test.txt");
|> |> $string = <FILEHANDLE>;
|
|
|> |doesn't this only get you the first line?
|
|Don't see this article on Sucker News.
Ok you don't see it; fine. But I am not quoting you, I am quoting Liang
Cheng. Sucker news sucker you?
|No, reads entire file as a single line.
|This is in clear evidence via my printed
|results in my article.
Which is what I said, ironically in support of your post.
|Hmm... *scratches her noggin*
|
|> Erm, see four lines above in your post.
|
|No, actually I don't see those four lines.
I don't know what to say about that. Visual accuity, not paying
attention, jumping to a conclusion. I can't even guess. Of course they
are four of chang3's lines so thay may have put you off your count.
|> $/ = ""; may not be optimal
|
|Why is this? Reads like Mere Assertion.
See Jeff Pinyan's message in same thread.
|Without supporting evidence and explanation
|your comments are dismissed as such,
|unsubstantiated Mere Assertion.
You go girl.
|> but it does negate your comment.
|
|Negates what comment and why?
That would be that Cheng saying your code wouldn't work. I said it
would. You didn't pay attention.
|
|> If you are going to do this with $/ then
|> $string = do { local $/; <FILEHANDLE> };
|> is cool
|
|Why is this "cool"? Looks like obfuscation to me.
cool cause $/ set to undef as it should and is localized. But, again
cool is as cool does. My cool may be your hot. TIMTOWTDI
|This is not cool for reading comprehension.
Clearly comprehension/cool is in the eye of the beholder in this case.
|
|> but read FILEHANDLE, $sting, -s FILEHANDLE;
|
|> is better for reasons that searching deja will provide.
|
|Really? What article subject line? What dates? Posted
You want me to do the searching for you? You post via Deja, you must
know how to search with it. I would say: Fish fishing yada yada yada; but
you are just being you so never mind.
HTH
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--Random Quote--
Even if you aren't in doubt, consider the mental welfare of the person
who has to maintain the code after you, and who will probably put parens
in the wrong place.
Larry Wall in the perl man page
------------------------------
Date: Tue, 12 Sep 2000 21:35:33 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: Where Doesn't this work?
Message-Id: <Pine.LNX.4.21.0009122120080.22498-100000@hawk.ce.mediaone.net>
On Wed, 13 Sep 2000, Gwyn Judd quoth:
GJ> I was shocked! How could Liang Cheng <Cheng3@email.msn.com>
GJ> say such a terrible thing:
GJ> >
GJ> >Brian <brian@ukdj.freeserve.co.uk> wrote in message
GJ> >news:8pm78b$ck1$1@news6.svr.pol.co.uk...
GJ> >> Where Doesn't this work? i am trying to remove all " from the file when it
GJ> >> is read in?
GJ> >> $SIZE=@LINES;
GJ> >In addition to Allan's post, you seem to want to get the size of the LINES
GJ> >array, that should be done with $SIZE =($#LINES +1);
GJ>
GJ> The two are equivalent.
Technically yes, but:
$SIZE = @LINES;
is the standard idiom for finding the length of an array, and is therefore
preferred (at least by me :-).
anm
--
print map y="= = && $_ => <"\bJust> =>
=> <"Another> =>
=> <"Perl> =>
=> <"Hacker\n> =>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4307
**************************************