[16034] in Perl-Users-Digest
Perl-Users Digest, Issue: 3446 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 21 18:10:36 2000
Date: Wed, 21 Jun 2000 15:10:20 -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: <961625420-v9-i3446@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 21 Jun 2000 Volume: 9 Number: 3446
Today's topics:
Re: perl CONSTANTS <rootbeer@redcat.com>
Perl Debugger <skpurcell@hotmail.com>
Re: Perl Debugger <peckert@epicrealm.com>
perl for automated scp arandachristian@hotmail.com
Re: Perl use DBI memory error <rootbeer@redcat.com>
Re: Perl, CGI, Browser differences eriks78@my-deja.com
Re: Perl, CGI, Browser differences <jeff@vpservices.com>
Re: Perl, CGI, Browser differences <rob13@rock13.com>
Programming Question <blumbjNOblSPAM@hotmail.com.invalid>
Re: Programming Question <rob13@rock13.com>
Re: q: next pair key in a hash (Tad McClellan)
Re: s/:(/:)/ if (@yourMind =~ m/SSL/) <rootbeer@redcat.com>
Re: Static Vars and ordering of subroutines <aqumsieh@hyperchip.com>
strict and @ISA <aperrin@davis.DEMOG.Berkeley.EDU>
Re: strict and @ISA (M.J.T. Guy)
Re: strict and @ISA <tony_curtis32@yahoo.com>
Re: strict and @ISA <sariq@texas.net>
Re: strict and @ISA (Tad McClellan)
Re: Sys::Syslog & _PATH_LOG <rootbeer@redcat.com>
Re: use Filter::netcrypt; ??? <rootbeer@redcat.com>
using cgi.pm for radio buttons <dpalmeNOSPAM@unitedtraffic.com>
XML Schema and datatypes with Perl shikida@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 21 Jun 2000 12:44:55 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: perl CONSTANTS
Message-Id: <Pine.GSO.4.10.10006211241430.4312-100000@user2.teleport.com>
On Wed, 21 Jun 2000, Samuel A. Mullen wrote:
> Does anyone know how much if any performance degradation is caused by
> the use of perl constants via the "use constant <CONSTANT_NAME>"
> module/pragma/whatever?
If it's not adequately covered in the module's docs, you could ask the
module's author. :-) But it's unlikely that it's enough to matter, in
most real-world programs. If you're really worried, Benchmark.
> I know that there is also a way of creating constant variables through
> the use of references and typeglobs. Is one way preferred over another?
The ones from 'use constant' can be optimized at compile time; the others
can't. If you have a complex expression which can be folded, that could
potentially be a significant performance savings. Also, if a conditional
expression can be resolved at compile time, there will be no runtime
overhead, which can become as large a savings as you'd like.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 21 Jun 2000 16:22:25 -0500
From: "spurcell" <skpurcell@hotmail.com>
Subject: Perl Debugger
Message-Id: <39513252$0$11873@wodc7nh1.news.uu.net>
Hello,
I want to start using the Perl Debugger a little more for "walking through
scripts that I have written".
I read the perldebug man page, but it is slightly cryptic, on how to do it
to existing files.
I tried
perl -de 0 "myperlfile"
but that takes me to a menu that asks to either quit or restart the
debugger.
Does anyone know how I can simply walk through a script, and check out the
values of variables, and also those of anonymous variables?
Thanks
Scott
------------------------------
Date: Wed, 21 Jun 2000 21:36:35 GMT
From: Paul Eckert <peckert@epicrealm.com>
Subject: Re: Perl Debugger
Message-Id: <3951353B.65B7507B@epicrealm.com>
spurcell wrote:
>
> Does anyone know how I can simply walk through a script, and check out the
> values of variables, and also those of anonymous variables?
The easiest way is:
perl -d myprogram.pl
Here's the debugger commands I commonly use:
'n' steps thru the program
'b' sets a breakpoint at the current line
'b 145' sets a breakpoint at line 145
'l' lists the program 10 or so lines at a time
'l mysub' starts listing the program at the sub mysub line
'print $myvar' prints the value of $myvar
'$myvar = "howdy" sets the value of $myvar in your program to "howdy"
In fact, any perl command (well, mostly) works at the debug line.
--
Paul Eckert
Sr. Software Engineer
Epicrealm Inc.
1651 N. Glenville Dr., Suite 212
Richardson, TX 75081
(972) 479-0135 x300
peckert@epicrealm.com
------------------------------
Date: Wed, 21 Jun 2000 19:41:44 GMT
From: arandachristian@hotmail.com
Subject: perl for automated scp
Message-Id: <8ir5pl$lmc$1@nnrp1.deja.com>
All,
I am writing a perl cgi script that will hopefully be used in the
following way:
1) it will use secure copy to copy a file to a predetermined
destination server.
2) it will allow users to enter a source host and filename
3) it will use RSA authentication
The script is running as nobody when it executes on the web server.
This is what I believe poses the problem. When running as nobody, I
receive the following error:
Could not create directory '//.ssh'.
The authenticity of host 'me.myco.com' can't be established.
Key fingerprint is [fingerprint here].
Are you sure you want to continue connecting (yes/no)?
If I am logged in as myself and chmod +s scriptname and run it as
nobody I get the same results.
Security isn't the main concern here since the servers are internal. I
understand that it's possible using RSA and CGI that the security could
be compromised.
What I am looking for is if anyone has done something similar to this,
and if so, how was it accomplished.
Many thanks,
Christian M. Aranda
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 21 Jun 2000 14:36:11 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl use DBI memory error
Message-Id: <Pine.GSO.4.10.10006211432170.4312-100000@user2.teleport.com>
On Wed, 21 Jun 2000 christykelly@my-deja.com wrote:
> i am getting a fatal memory error. I know this is
> really stupid, but i am running out of ideas on
> what is wrong.
Almost certainly, either the module or your perl installation is messed
up. If that's not it, it's either your OS or - surprise! - your memory.
You may need to have your hardware checked or improved. But I'd start with
reinstalling the module, and go on from there.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 21 Jun 2000 17:58:30 GMT
From: eriks78@my-deja.com
Subject: Re: Perl, CGI, Browser differences
Message-Id: <8iqvnr$heu$1@nnrp1.deja.com>
> IExplorer but with Netscape the text appears underlined? No matter
> what <Font> tags I try.
what do you mean text appears underlined?
do you mean links appear underlined?
if this is the case, you probably have IE settings specifiing links as
hover tags or never underlined.
post some more info.
--erik
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 21 Jun 2000 11:17:12 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Perl, CGI, Browser differences
Message-Id: <395106A8.59FF9065@vpservices.com>
eriks78@my-deja.com wrote:
>
> > IExplorer but with Netscape the text appears underlined? No matter
> > what <Font> tags I try.
>
> what do you mean text appears underlined?
> do you mean links appear underlined?
> if this is the case, you probably have IE settings specifiing links as
> hover tags or never underlined.
Or you simply forgot to close an <a href> and Netscape noticed that you
left off the closing but IE was too lame to notice the mistake.
> post some more info.
No, please do not post more info (at least not on clpm), please do as
others have advised and ask your question in a newsgroup about browsers.
--
Jef
------------------------------
Date: Wed, 21 Jun 2000 15:50:50 -0400
From: "Rob - Rock13.com" <rob13@rock13.com>
Subject: Re: Perl, CGI, Browser differences
Message-Id: <39511C9A.89FECB9B@rock13.com>
Phil wrote:
>
> Can anyone tell me why a simple script that outputs html can work OK with
> IExplorer but with Netscape the text appears underlined? No matter what
> <Font> tags I try.
> Thanks
>
> p.s. viewing the HTML source of the output page does not indicate any reason
> why it should be underlined
Well it must be HTML related since the output is in HTML. Post the URL
to somewhere such as alt.html
--
Rob
http://rock13.com/webhelp/
Fight Spam - http://www.cauce.org/
------------------------------
Date: Wed, 21 Jun 2000 13:32:32 -0700
From: Bob <blumbjNOblSPAM@hotmail.com.invalid>
Subject: Programming Question
Message-Id: <15690460.5acac8de@usw-ex0101-008.remarq.com>
Could some kind person out there please take a look at a PERL
script I've
downloaded and tell me how I can modify to do what I want.
I am trying to have user enter their name and e-mail address on
a form.
Then, when they submit the form, it should be written to an HTML
file, being
added to the names & e-mail addresses of other respondents.
All this works fine. The only problem is that it spreads the
responses out
across the page, like so:
name -- Roger Ranger email -- rranger@hotmail.com name -- John
Brown
email -- bbody@mail.com name -- Sally Smith email --
ssmith@mail.com name --
Harold Finehair email -- finehairh@mail.com name -- Hedda Hopper
email --
hopperh@buzzwords.com
What I want it to do is the following:
name -- Roger Ranger
email -- rranger@hotmail.com
name -- John Brown
email -- bbody@mail.com
name -- Sally Smith
email -- ssmith@mail.com
If someone is willing to take a look at the script, I can e-mail
it to them.
Many thanks.
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Wed, 21 Jun 2000 17:26:05 -0400
From: "Rob - Rock13.com" <rob13@rock13.com>
Subject: Re: Programming Question
Message-Id: <395132ED.3E81FA42@rock13.com>
Bob wrote:
>
> Could some kind person out there please take a look at a PERL
> script I've
> downloaded and tell me how I can modify to do what I want.
>
> I am trying to have user enter their name and e-mail address on
> a form.
> Then, when they submit the form, it should be written to an HTML
> file, being
> added to the names & e-mail addresses of other respondents.
>
> All this works fine. The only problem is that it spreads the
> responses out
> across the page, like so:
>
> name -- Roger Ranger email -- rranger@hotmail.com name -- John
> Brown
> email -- bbody@mail.com name -- Sally Smith email --
> ssmith@mail.com name --
> Harold Finehair email -- finehairh@mail.com name -- Hedda Hopper
> email --
> hopperh@buzzwords.com
>
> What I want it to do is the following:
>
> name -- Roger Ranger
> email -- rranger@hotmail.com
>
> name -- John Brown
> email -- bbody@mail.com
>
> name -- Sally Smith
> email -- ssmith@mail.com
>
> If someone is willing to take a look at the script, I can e-mail
> it to them.
You just need to print a \n after priting the email address. If this
doesn't help go ahead and email the script to me and I'll take a look.
--
Rob
http://rock13.com/webhelp/
Fight Spam - http://www.cauce.org/
------------------------------
Date: Wed, 21 Jun 2000 13:37:13 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: q: next pair key in a hash
Message-Id: <slrn8l22qp.116.tadmc@maxim.metronet.com>
On Wed, 21 Jun 2000 16:26:59 +0400, Roman Chumakov <zfido88@zr.ru> wrote:
>But how can I know previous key in a $hash, that is previos $key?
Perl FAQ, part 4:
"How can I make my hash remember the order I put elements into it?"
>it's like.... i have a book ..
But a hash is not like a book.
A book has pages in order.
A hash has _unordered_ elements.
You have chosen the wrong data structure.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 21 Jun 2000 12:38:34 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: s/:(/:)/ if (@yourMind =~ m/SSL/)
Message-Id: <Pine.GSO.4.10.10006211237470.4312-100000@user2.teleport.com>
On Wed, 21 Jun 2000 robb4444@my-deja.com wrote:
> I would like to be able to print and/or store the headers called
> "Client-SSL-Cipher","Client-SSL-Cert-Subject","Client-SSL-Cert-
> Issuer". These are defined in sub _get_sock_info in https.pm ... the
> perl module lovingly known as LWP::Protocol::HTTPS.
Perhaps you want to patch that module to give you the methods you want.
They don't sound hard to write. Be sure to send the patch to the module's
author. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 21 Jun 2000 20:18:26 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Static Vars and ordering of subroutines
Message-Id: <7a4s6mbxf2.fsf@merlin.hyperchip.com>
Wolfgang Hielscher <W.Hielscher@mssys.com> writes:
> By replacing
> my $static_x = 3;
> with
> my $static_x = (print( "init\n" ),3);
> in both your examples, you should see what goes "wrong".
>
> Obviously, defining and initializing variables are two different steps
> in Perl. In your example, you could have written:
> my $static_x;
> $static_x = 3;
> So the initialization is done, when the block itself is executed.
Yes, I am aware of that. Variable definition happens at compile-time,
while the actual initialization happens at run-time. Actually, my
question was to see whether people think this is "correct" behaviour or
not.
Yet it seems like a bug to me. Let's look at the code again:
my $x = getNextX();
print "X is $x.";
{
my $static_x = 3;
sub getNextX {
return ++$static_x;
}
}
__END__
The value of the global $x variable is the return value of the
subroutine getNextX(). This, in turn, depends on the value of the
lexically-scoped variable $static_x. It doesn't seem "correct" that perl
would evaluate the subroutine, and return a value, before completely
evaluating its context. I know that, at that point, the interpreter
hasn't yet seen the initialization step, but I think perl should step
back, and look at the whole context.
On the other hand, I see BIG obfuscation potential here :-)
> Done some C-programming lately?! ;-)
Not really. Perl has found the lazy person in me, and wouldn't let go
:-)
--Ala
------------------------------
Date: 21 Jun 2000 11:05:21 -0700
From: Andrew Perrin - Demography <aperrin@davis.DEMOG.Berkeley.EDU>
Subject: strict and @ISA
Message-Id: <u5kvgz2kizi.fsf@davis.DEMOG.Berkeley.EDU>
Quick question: what is the proper way to make strict not complain
about @ISA requiring a package name? Packages that don't work under
use strict make me queasy, but @ISA = qw(foo bar) sets off the alarms.
Thanks.
--
---------------------------------------------------------------------
Andrew J. Perrin - aperrin@demog.berkeley.edu - NT/Unix Admin/Support
Department of Demography - University of California at Berkeley
2232 Piedmont Avenue #2120 - Berkeley, California, 94720-2120 USA
http://demog.berkeley.edu/~aperrin --------------------------SEIU1199
------------------------------
Date: 21 Jun 2000 18:19:43 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: strict and @ISA
Message-Id: <8ir0vv$i8f$1@pegasus.csx.cam.ac.uk>
In article <u5kvgz2kizi.fsf@davis.DEMOG.Berkeley.EDU>,
Andrew Perrin - Demography <aperrin@davis.DEMOG.Berkeley.EDU> wrote:
>Quick question: what is the proper way to make strict not complain
>about @ISA requiring a package name? Packages that don't work under
>use strict make me queasy, but @ISA = qw(foo bar) sets off the alarms.
Just the same way you stop "use strict" complaining about any other
variable:
i) put the initialisation before the "use strict"
ii) use vars '@ISA';
iii) qualify it: @my_package::ISA = qw(foo bar);
iv) turn off strict: { no strict; @ISA = qw(foo bar) };
Take your pick.
Mike Guy
------------------------------
Date: 21 Jun 2000 13:20:18 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: strict and @ISA
Message-Id: <87bt0usxp9.fsf@limey.hpcc.uh.edu>
>> On 21 Jun 2000 11:05:21 -0700,
>> Andrew Perrin - Demography <aperrin@davis.DEMOG.Berkeley.EDU> said:
> Quick question: what is the proper way to make strict
> not complain about @ISA requiring a package name?
> Packages that don't work under use strict make me
> queasy, but @ISA = qw(foo bar) sets off the alarms.
Until recently
use vars qw(@ISA ... );
But
perldoc perlmodlib
suggests that our() is the way forward,
perldoc -f our
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: Wed, 21 Jun 2000 13:26:20 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: strict and @ISA
Message-Id: <395108CC.E688E9F6@texas.net>
Andrew Perrin - Demography wrote:
>
> Quick question: what is the proper way to make strict not complain
> about @ISA requiring a package name? Packages that don't work under
> use strict make me queasy, but @ISA = qw(foo bar) sets off the alarms.
Do you mean:
use vars qw(@ISA);
?
Or just fully qualify it.
- Tom
------------------------------
Date: Wed, 21 Jun 2000 13:44:10 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: strict and @ISA
Message-Id: <slrn8l237q.116.tadmc@maxim.metronet.com>
On 21 Jun 2000 11:05:21 -0700, Andrew Perrin - Demography
<aperrin@davis.DEMOG.Berkeley.EDU> wrote:
>Quick question: what is the proper way to make strict not complain
>about @ISA requiring a package name?
^^^^^^^^^^^^^^^^^^^^^^^^
err, by including the package name? :-)
>Packages that don't work under
>use strict make me queasy, but @ISA = qw(foo bar) sets off the alarms.
@MyPackage::ISA = qw(foo bar);
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 21 Jun 2000 12:55:30 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Sys::Syslog & _PATH_LOG
Message-Id: <Pine.GSO.4.10.10006211246110.4312-100000@user2.teleport.com>
On Wed, 21 Jun 2000, Daniel Weber wrote:
> I posted this originally in c.l.p.modules, but it hasn't turned up any
> responses. Probably should have cross-posted to begin with.
Probably so....
> Date: Mon, 19 Jun 2000 17:06:40 -0500
...but maybe you didn't wait long enough for an answer before trying
again. From Monday evening to Wednesday morning isn't all that long.
> > t/config............Your vendor has not defined the Sys::Syslog macro _PATH_LOG
> > at /usr/local/encap/perl-5.6.0/lib/perl-5.6.0/IP22-irix-thread-multi/Sys/Syslog.
> > pm line 277.
> 277 is the line:
> > my $syslog = &_PATH_LOG || croak "_PATH_LOG not found in syslog.ph";
>
> As far as I can tell, syslog.ph isn't included with a require by this version of
> Syslog.pm as in earlier versions of perl, so that croak message probably isn't
> correct.
But also note that the message you're getting is not from the croak().
You may have found a bug with this module. Try to figure out how to patch
it to Do The Right Thing, whatever that is, and submit the patch with
perlbug. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 21 Jun 2000 12:41:21 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: use Filter::netcrypt; ???
Message-Id: <Pine.GSO.4.10.10006211238480.4312-100000@user2.teleport.com>
On Wed, 21 Jun 2000 moijk@my-deja.com wrote:
> Is it possible to decrypt a file crypted with Filter::netcrypt?
If it's not useless, yes. Of course, I'm not claiming that it's easy to
do! :-)
> And is it possible to get the module for personal use or is it a
> "private" one?
Since it's not on CPAN, you'll have to ask its author, or at least whoever
told you about it.
> The program crypted with it isn't the most well documented one so I'd
> like to see how the program it constructed to solve the barrears I've
> reacherd. (and it's many of them)
I'd suggest that you ask _that_ program's author for the source. He or she
seems to have gone to some trouble to make it difficult for you to read,
though, so you may not be able to get it. That'll teach you to use
proprietary code. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 21 Jun 2000 21:14:19 GMT
From: "D.W." <dpalmeNOSPAM@unitedtraffic.com>
Subject: using cgi.pm for radio buttons
Message-Id: <01bfdbc5$1eec34e0$cf0114ac@raptor.unitedtraffic.com>
I've been trying to get the radio_group to work but it seems like my perl
script is just completely ignoring it. Here is exactly what I have:
print radio_group(-name=>"DRIVER",
-values=>["S", "T"],
-default=>$driver,
-labels{"S"=>"Solo", "T"=>"Team"});
Would someone tell me what I'm doing wrong with this?
Douglas
------------------------------
Date: Wed, 21 Jun 2000 20:09:04 GMT
From: shikida@my-deja.com
Subject: XML Schema and datatypes with Perl
Message-Id: <8ir7ci$n15$1@nnrp1.deja.com>
I want to check datatypes using XML Schemas with perl.
Is there any library I can use to do this?
Seems that the most popular XML parser for perl don't check datatypes.
best regards
Kenji
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 3446
**************************************