[19422] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1617 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 26 09:10:26 2001

Date: Sun, 26 Aug 2001 06:10:12 -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: <998831412-v10-i1617@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 26 Aug 2001     Volume: 10 Number: 1617

Today's topics:
    Re: read <gnarinn@hotmail.com>
    Re: Self-Searchable Perl documention - Extremely Useful (Yves Orton)
    Re: Sex or Perl?  Which is better? (John J. Trammell)
    Re: Sex or Perl?  Which is better? <dscarlett@optushome.com.au>
    Re: Sex or Perl?  Which is better? <bcaligari@fireforged.com>
    Re: Sex or Perl?  Which is better? <pne-news-20010826@newton.digitalspace.net>
        simple question im sure (.net.org.us.tv.cc)
    Re: simple question im sure <Tassilo.Parseval@post.rwth-aachen.de>
    Re: simple question im sure (.net.org.us.tv.cc)
        Telnet front-end <agm@physics.berkeley.edu>
    Re: Telnet front-end (Logan Shaw)
    Re: warnings with cgi will crash Win32 perl core (Yves Orton)
    Re: warnings with cgi will crash Win32 perl core <Tassilo.Parseval@post.rwth-aachen.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 26 Aug 2001 10:16:12 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: read
Message-Id: <998820972.497860766947269.gnarinn@hotmail.com>

In article <pm%h7.22792$A5.69934@news1.eburwd1.vic.optushome.com.au>,
David Scarlett <dscarlett@optushome.com.au> wrote:
>"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
>news:3B887BD8.8538222C@stomp.stomp.tokyo...
>>
>> I am personally more curious what is your valid reason
>> for not simply testing this to discover an answer.
>
>The first of the three principal virtues of a programmer.

this is False Laziness

it is much easier and faster just to make such a simple test than
to post the question onto usenet, wait for it to propagate,
wade through the answers you get, filter out the flames,
find your answer (if you get an usable one)

specially as you have to test it any case, because do you
*know* these people? do you trust them? what do they know anyways?


gnari


------------------------------

Date: 26 Aug 2001 05:52:37 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: Self-Searchable Perl documention - Extremely Useful!
Message-Id: <74f348f7.0108260452.6a0864a5@posting.google.com>

Philip Newton <pne-news-20010826@newton.digitalspace.net> wrote in message news:<qq1hot08j36l7374fo1ggam7g3fmfa9cb2@4ax.com>...
> On 25 Aug 2001 08:43:46 -0700, demerphq@hotmail.com (Yves Orton) wrote:
> 
> > dkcombs@panix.com (David Combs) wrote in message news:<9ll790$fvi$2@news.panix.com>...
> > >
> > > How about posting it here so everyone can see it too.
> > 
> > im not sure the usenet is the place to post a 600line script.
> 
> So put it on the web and post the URL. That's what people usually do for
> longer things -- even for, say, long code samples.

Hi Philip, with all due respect I dont consider the script to be mine
to post on a web page (not to mention I dont have a home page and am
not interested in setting one up just now).  If John wishes to post
then he has a copy and he can do so.  If you would like a copy I will
email it to you.

Yves


------------------------------

Date: 26 Aug 2001 07:08:14 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: Sex or Perl?  Which is better?
Message-Id: <slrn9ohn8l.41f.trammell@haqq.hypersloth.net>

On 25 Aug 2001 20:48:44 -0700, None <pohanl@aol.com> wrote:
> In the beginning there was sex.  Then came Perl.  Which is better?
[snip]

<plonks AOL, google, and every From: address containing
 the letter 'p', just to be sure>



------------------------------

Date: Sun, 26 Aug 2001 07:22:57 GMT
From: "David Scarlett" <dscarlett@optushome.com.au>
Subject: Re: Sex or Perl?  Which is better?
Message-Id: <lt1i7.22832$A5.69894@news1.eburwd1.vic.optushome.com.au>

"John J. Trammell" <trammell@haqq.hypersloth.invalid> wrote in message
news:slrn9ohn8l.41f.trammell@haqq.hypersloth.net...
> On 25 Aug 2001 20:48:44 -0700, None <pohanl@aol.com> wrote:
> > In the beginning there was sex.  Then came Perl.  Which is better?
> [snip]
>
> <plonks AOL, google, and every From: address containing
>  the letter 'p', just to be sure>

That's pretty stupid. "@webtv.com" doesn't have any 'p's in it. ;-)


--
David Scarlett
dscarlett@optushome.com.au
http://www.listen.to/artifice/
http://members.optushome.com.au/dscarlett/

" :-( + |_|? = :-) "
        -Lipton (tea) ad on the side of a tram.





------------------------------

Date: Sun, 26 Aug 2001 10:44:51 -0000
From: "Brendon Caligari" <bcaligari@fireforged.com>
Subject: Re: Sex or Perl?  Which is better?
Message-Id: <9majj80ekd@enews1.newsguy.com>


"None" <pohanl@aol.com> wrote in message
news:12124e47.0108251948.44fc310f@posting.google.com...
> In the beginning there was sex.  Then came Perl.
> Which is better?  Before getting into this very
> important question, history must be explained.

<snip snip....a lot>

> do
> with sex?  Well, which is better?  Sex or Perl?

For your essay:   D. The world is more complex than 1st semester economics,
marketing and political science.  Wait till you start looking at fiscal and
monetary policy.  Have you ever thought about what things would be like if
'money' was liberalised rather than 'monopolised' by nations?  Which is
better? Sex or Perl?  That's a very subjective question.  Typically, a
perl-enabled person spends more time doing Perl than having sex.  However,
we spend more time talking than eating.  However, I can give you an advice.
Stick to Perl.  If you're such a long long winded bore I seriously doubt
you'll manage to get laid.

B






------------------------------

Date: Sun, 26 Aug 2001 14:40:47 +0200
From: Philip Newton <pne-news-20010826@newton.digitalspace.net>
Subject: Re: Sex or Perl?  Which is better?
Message-Id: <vhrhotcqhbbako4a1nb4oq5conudbo2qhu@4ax.com>

On Sun, 26 Aug 2001 07:22:57 GMT, "David Scarlett"
<dscarlett@optushome.com.au> wrote:

> "John J. Trammell" <trammell@haqq.hypersloth.invalid> wrote in message
> news:slrn9ohn8l.41f.trammell@haqq.hypersloth.net...
> > On 25 Aug 2001 20:48:44 -0700, None <pohanl@aol.com> wrote:
> > > In the beginning there was sex.  Then came Perl.  Which is better?
> > [snip]
> >
> > <plonks AOL, google, and every From: address containing
> >  the letter 'p', just to be sure>
> 
> That's pretty stupid. "@webtv.com" doesn't have any 'p's in it. ;-)

Maybe he wanted to catch '@hopmail.com' :)

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: 26 Aug 2001 11:36:15 GMT
From: lordralph65@aol.com (.net.org.us.tv.cc)
Subject: simple question im sure
Message-Id: <20010826073615.04377.00005152@mb-mh.aol.com>

how come i get the message:
Use of uninitialized value in concatenation (.) or string at ./cam.pl line...
when i compare a variable to 1 like this "if($variable == 1)" but i dont
get it if compare it like "if($variable == 0x01)" or "if($variable == 193901)"
note, i dont want to compare it to 193901 or 0x01, i want to compare it
to 1, but i was trying to figure out why it wouldnt work

any help would be greatly appreciated..

nick


------------------------------

Date: Sun, 26 Aug 2001 14:19:10 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: simple question im sure
Message-Id: <3B88E93E.5030706@post.rwth-aachen.de>

 .net.org.us.tv.cc wrote:

> how come i get the message:
> Use of uninitialized value in concatenation (.) or string at ./cam.pl line...
> when i compare a variable to 1 like this "if($variable == 1)" but i dont

No, you don't get the above warning when doing such a comparison. In 
this case you'd have got: Use of uninitialized value in numeric eq (==) 
at...

Your warning must have been triggered in another line of code. 
Supposedly one where you concatenate strings together (hence this 
warning) that were in fact empty.

Tassilo

-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



------------------------------

Date: 26 Aug 2001 12:52:09 GMT
From: lordralph65@aol.com (.net.org.us.tv.cc)
Subject: Re: simple question im sure
Message-Id: <20010826085209.04385.00004207@mb-mh.aol.com>

woo hoo! i figured it out. the problem with
the program takes place 2 lines AFTER
the line specified in the error.. programming
books always say too look in the code
before the line specified in the error, so
thats where i looked..  anywayz, thanks
for the help =]

nick


------------------------------

Date: Sun, 26 Aug 2001 00:13:28 -0700
From: Antonio <agm@physics.berkeley.edu>
Subject: Telnet front-end
Message-Id: <3B88A198.1916B4BC@physics.berkeley.edu>

I need to make a front-end to a program that, among other things,
invokes standard telnet after soliciting a login and password. The
program would prompt the user for various information, and then after
having a login session, would let telnet function from that point on.

Something like...

>Would you like to check email now? (y/n)
>Login: myself
>Password:

>You have mail.
serverX>


And then telnet would go from there.

How do I handle the information in/out of the login and password, and
feed it seemlessly into telnet? I know the basics of Term::Readkey for
the login prompts, but I have no idea how to feed the vital info into
telnet and have it integrate itself into the program.

Any suggestions? Antonio.



------------------------------

Date: 26 Aug 2001 02:23:04 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Telnet front-end
Message-Id: <9ma84o$1h0$1@charity.cs.utexas.edu>

In article <3B88A198.1916B4BC@physics.berkeley.edu>,
Antonio  <agm@physics.berkeley.edu> wrote:
>I need to make a front-end to a program that, among other things,
>invokes standard telnet after soliciting a login and password. The
>program would prompt the user for various information, and then after
>having a login session, would let telnet function from that point on.

Wouldn't it be much easier just to not use telnet and instead use
something that allows you to do a remote login without having to enter
a username and password interactively?  The most likely candidate is
Secure Shell.  See http://www.ssh.com/ and http://www.openssh.com/ .

  - Logan
-- 
"Our grandkids love that we get Roadrunner and digital cable."
(Advertisement for Time Warner cable TV and internet access, July 2001)


------------------------------

Date: 26 Aug 2001 04:58:56 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: warnings with cgi will crash Win32 perl core
Message-Id: <74f348f7.0108260358.633c61e7@posting.google.com>

"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message news:<3B886CDF.6935963B@stomp.stomp.tokyo>...
> I have been playing around with warnings in the format
> of -w to discover how many other ways use of warnings
> screws up a Perl script. They are numerous.

You should post some samples.  Also the way you refer to warnings via
the -w switch makes me wonder. do you use strict;?  If you dont then I
wonder what happens if you put use strict in your code?  Does it fail
to build?  Could that be the problem?

> My initial method began with use of,
> 
> BEGIN
>  {
>   use CGI::Carp qw(carpout);
>   open (WARNINGS, ">c:/apache/users/test/warning.txt");
>   carpout(*WARNINGS);
>  }
> 
> This proved to be useful for a few mistakes I made in a
> very large four-thousand line script. Several never used
> variables were found. I also received over five-hundred
> lines of false information, which I found humorous.

False information?  Hmm. Are you sure?

> 
> Later today, I dumped Carp and began researching a
> new avenue of approach for discovering other ways
> use of warnings will totally FUBAR a script.

The only way I know to have Carp screw things is when you override ""
and then put a carp/croak call in the stringify routine.

> I simply retained -w after my Perl locale first
> line and switched from a command line to a browser,
> after removal of Carp. What a circus is warnings.

Well if you used the wordy version instead you could turn on and off
various parts of the warnings system.

use warnings;

> Today I discovered warnings provide false information
> about use of my declarations within sub-routines, this is,
> "...not be shared..." warning. In this case, warnings is
> reporting a message my declared variables inside typical
> sub-routins along with if conditionals and various loop
> mechanisms employing my declarations, these my declared
> variables will not be shared on a global basis or psuedo
> global basis, which is exactly as intended via my code.
> Warnings, in this case, provides erroneous information.

Hmm. Now I am very suspicious Zilla. The ONLY time i have seen the
"...not be shared..." was when I was doing something subtly by very
wrong. (I believe it had to do with creating a closure and the
variable that I wanted to live in the closure was for some reason not
going to be. I cant remember the fine details, just that it WAS a real
bug.) Post some code samples and the warnings.  My bet is that the
warnings are legit and that you arent doing what you think you are
doing.

> 
> Warnings also cop an "unitialized" message when working
> with typical cgi environmental variables. This message,
> as with not shared my declarations, is erroneous.

So if you test the cgi enviornemental variable it doesnt have a value
of undef? But upon use it warns()?  Post the code that demonstrates
this.

> 
> Most annoying, if warnings are enabled with -w for a
> complex and sizable cgi script, this hurls perl core
> into an infinite loop which can only be terminated
> with a kill process or a system shut down and restart.
> Fortunately, my system has seven-hundred-sixty-eight
> megabytes of RAM. Easy enough to recover, actually
> this infinite loop is not noticed on my machine save
> for no output from my cgi script under test.

This doesnt make much sense either.  Can you demonstrate this 'hurls
the perl core into an infinite loop'?  What code causes this to
happen?  Also if it is indeed an infinite loop why would 768MB make
any difference?  This sounds bogus to me.

> An average machine would not recover.

Uh huh.  But the lizardputer is more robust....
 
> This applies to Win9.x, Win.me and I believe, Win2000.

So have you or have you not tested it on a W2k box?  

> So, you Perl 5 Cargo Cultists, when you dictate to others,
> "You MUST always use warnings" you are also dictating,
> under frequent and common circumstances,
> 
> "You MUST always crash your system."
> 
> "You MUST always crash perl core."
> 
> "You MUST always generate false warnings."

This is the kinda lizardism that pisses people off Kira.  I and my
colleagues write scripts ONLY with warnings enabled and frankly a big
chunk of the modules in cpan and ppm are written with warnings
enabled, in all of my time perling i have NEVER had any of the above
happen.  I have never had Perl crash my OS (ok ok I use a real OS, not
one of the Dos throwbacks) I have never crashed the perl core
(whatever that means exactly) and I have never seen a warning that
with some minor code changes I couldnt make go away. (Like
initializing a variable....).

> Yes, you MUST do things or be declared a heretic
> and, with ample chest thumping, be summarily
> killfiled then banished from Perl Perl Land.

Its not that what you are saying is heretical, but rather
unsubstanciated.  Post your code that generates these 'false warnings'
and your code that crashes your system and peer review will take it
from there.  I thought you were an academic, you _DO_ understand the
idea of peer review dont you?

Yves


------------------------------

Date: Sun, 26 Aug 2001 14:15:29 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: warnings with cgi will crash Win32 perl core
Message-Id: <3B88E861.4020002@post.rwth-aachen.de>

Yves Orton wrote:

>>Most annoying, if warnings are enabled with -w for a
>>complex and sizable cgi script, this hurls perl core
>>into an infinite loop which can only be terminated
>>with a kill process or a system shut down and restart.
>>Fortunately, my system has seven-hundred-sixty-eight
>>megabytes of RAM. Easy enough to recover, actually
>>this infinite loop is not noticed on my machine save
>>for no output from my cgi script under test.
>>
> 
> This doesnt make much sense either.  Can you demonstrate this 'hurls
> the perl core into an infinite loop'?  What code causes this to
> happen?  Also if it is indeed an infinite loop why would 768MB make
> any difference?  This sounds bogus to me.

Hehe, I remember having once written something like:

sub parts(@_) {
	eval { shift->parts(@_); }; #instead of SUPER::parts
}

and wondered why all my memory filled up within half a second...only 
chance to cleanly reboot was using the magic sysrequest stuff. I guess 
it would have made no difference if I had had 768MB or even 40 TB of 
RAM. The lock just would have come a second later.

Tassilo
-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



------------------------------

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 1617
***************************************


home help back first fref pref prev next nref lref last post