[9970] in Perl-Users-Digest
Perl-Users Digest, Issue: 3563 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 27 15:02:52 1998
Date: Thu, 27 Aug 98 12:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 27 Aug 1998 Volume: 8 Number: 3563
Today's topics:
Re: \\ ...what's the point? <merlyn@stonehenge.com>
Re: \\ ...what's the point? (Larry Rosler)
Re: Are $a and $b some special variables? <maierc@chesco.com>
Re: backticks and windows (Bob Trieger)
Re: COBOL and Perl <charles@hankel.mersinet.co.uk>
Re: COBOL and Perl <charles@hankel.mersinet.co.uk>
Re: Code Style (Was: How to sort this associative array (Abigail)
Re: Code Style (Was: How to sort this associative array (Abigail)
Re: Code Style (Was: How to sort this associative array <zenin@bawdycaste.org>
Re: Code Style (Was: How to sort this associative array (Larry Rosler)
Re: comp.lang.perl.windows.misc (Greg Bacon)
Compiled Perl for HP-UX 9.04? <lee.davies@NOSPAMsaaconsultants.com>
Re: Compiled Perl for HP-UX 9.04? (Larry Rosler)
Re: Determining strlen (Nathan V. Patwardhan)
Re: Max value in an array <merlyn@stonehenge.com>
Re: Max value in an array <merlyn@stonehenge.com>
Misinterpreted => why no true/false keywords? <nonspammers.start.after.this.period.hot_redox@hotmail.com>
Re: Misinterpreted => why no true/false keywords? (Mark-Jason Dominus)
Re: need and INI File parser in perl <psuravar@cisco.com>
newbie variable question... <pepstud@nortel.ca>
Perl calling Perl jeanmar@my-dejanews.com
Re: Perl compiler (Nathan V. Patwardhan)
Re: Perl compiler (Albert W. Dorrington)
Re: Perl compiler (John Stanley)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 27 Aug 1998 18:05:22 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: \\ ...what's the point?
Message-Id: <8caf4qi9m4.fsf@gadget.cscaper.com>
>>>>> "Tom" == Tom Phoenix <rootbeer@teleport.com> writes:
Tom> On Thu, 27 Aug 1998, Palisade Europe wrote:
>> why not not just a single exception to
>> characters within a single-quoted string
Tom> Because this is the way Larry decided to do it. :-)
Tom> I think it's easier to parse, too. Hope this helps!
It's also need on those odd cases where you want a backslash
as the last character of your string. Try this:
print 'I can\'t hear you', "\n";
print 'This line ends with a backslash \\', "\n";
Unless we could represent \ as \\, there'd be no way to write that
last one.
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Thu, 27 Aug 1998 11:37:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: \\ ...what's the point?
Message-Id: <MPG.104f474d68557c669897fc@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <Pine.GSO.4.02A.9808270958370.4382-100000@user2.teleport.com>
on Thu, 27 Aug 1998 16:59:09 GMT, Tom Phoenix <rootbeer@teleport.com>
says...
> On Thu, 27 Aug 1998, Palisade Europe wrote:
>
> > why not not just a single exception to
> > characters within a single-quoted string
>
> Because this is the way Larry decided to do it. :-)
When I began to study Russian, I asked the instructor why such-and-such
was said the way it was. He answered, "Because that's the way the first
Russian said it." In Perl, we know who 'the first Russian' is!
But in fact, all this traces at least as far back as the original Bourne
shell:
A character can be quoted (i.e., made to stand for itself) by
preceding it with a \. The pair \new-line is ignored. All
characters enclosed between a pair of single quote marks (''),
except a single quote, are quoted. Inside double quote marks
(""), parameter and command substitution occurs and \ quotes the
characters \, `, ", and $. "$*" is equivalent to "$1 $2 ...",
whereas "$@" is equivalent to "$1""$2" ....
I argued that it would be more intuitive to use single quotes for
'weaker' quoting (i.e., allowing interpolation via $...) and double
quotes for "stronger" quoting (i.e., not allowing interpolation), but I
lost. So here we are...
--
(Yet Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 28 Aug 1998 02:03:11 -0400
From: Charles Maier <maierc@chesco.com>
Subject: Re: Are $a and $b some special variables?
Message-Id: <35E6481F.8BA50814@chesco.com>
Russ Allbery wrote:
>
> Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
> > karlon@bnr.ca wrote:
>
> >> To paraphrase: $a and $b are package globals exempt from "use strict"
> >> restrictions.
>
> > ... which is a long-standing bug in the warn()er. I wonder why nobody
> > would fix it...
>
> Because figuring out whether a routine could have been called from a sort
> routine is impossible in the general case and adding more specific special
> cases just makes the whole situation even more confusing.
>
> And besides, like Larry said, it's rather rare for people to typo $a and
> $b.
>
Thanks for clearing that up. The $a and $b references have always been
thought of as "it just 'woikes' that way" ;o)
Regards..
--
Chuck Maier
CDM Consulting Services
http://www.cdmcon.com
(610) 942-2726
------------------------------
Date: Thu, 27 Aug 1998 16:17:46 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: backticks and windows
Message-Id: <6s411g$7c$1@ligarius.ultra.net>
[ posted to usenet and courtesy e-mail sent to b_redeker@hotmail.com]
b_redeker@hotmail.com wrote:
-> now I am convinced that this must be a FAQ,
-> so if you know where to find the answer,
-> please send me there
->
-> $out = `echo hey`;
-> print "Output: $out\n";
->
-> In the above, $out doesn't capture the output.
Works fine for me on NT4.0 and Win95 using perl 5.004_02
-> So what am I doing wrong? (besides using windows =o)
Whatever you're doing wrong isn't in the 2 lines of code you posted.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972
Ext: 1949 and let the jerk that answers know
that his toll free number was sent as spam. "
------------------------------
Date: Thu, 27 Aug 1998 12:55:18 +0100
From: Charles F Hankel <charles@hankel.mersinet.co.uk>
Subject: Re: COBOL and Perl
Message-Id: <35E54926.D6ABCD4E@hankel.mersinet.co.uk>
Georg Bauer wrote:
>
> In article <6rnji0$6ug$2@news.iastate.edu>, kortbein@iastate.edu (Josh
> Kortbein) wrote:
>
> >from 2-4 copies. And these were generally people who have shown in
> >the past that they can exercise control over their newsreaders.
>
> Look at the IDs. Different domain-parts. Me thinks it is some luser-system
> that reexports messages with changed IDs.
Well, I haven't been able to witness these effects but I do agree from
what's been said that it seems like something downstream is changing
message IDs, otherwise you wouldn't get multiple occurrences, and maybe
that's because it's generating multiple copies and needs a new ID for
each one.
My experience with some the backbone providers to date has been
chequered. One news support guy asserted that he had the best server
and service in the business and wouldn't believe that comp.lang.cobol
existed. After pressing the complaint to his boss, he still maintained
his assertion and I had to forward the charter to the boss who then got
it sorted out. Bear in mind also that they don't like to deal with the
end users but needs must when they ignore the ISP's representations.
--
Charles F Hankel Wirral UK
------------------------------
Ready, Willing and (avail)Able
------------------------------
Date: Thu, 27 Aug 1998 13:58:47 +0100
From: Charles F Hankel <charles@hankel.mersinet.co.uk>
Subject: Re: COBOL and Perl
Message-Id: <35E55807.4D7AEFDC@hankel.mersinet.co.uk>
Gary L. Burnore wrote:
>
> I always thought of Selcopy as a language.
Going by the term described elsewhere on this thread, I'm now inclined
to agree with you. There's a couple of things that I really like about
Selcopy apart from its ease of use.
First, CBL have never tried to promote it beyond its original purpose,
as a tool for programmers that is very easy to use for those one-off
tasks. Of course, many of us know of Selcopy being used in the live
environment and sometimes in ways that the product's designers did not
originally envisage. However, it still remains what it was, without
pretensions to "higher" things, unlike some of its competitor products
like Easytrieve.
Second, AFAIK it's not yet been bought up by Computer Associates and
been rebadged to make it look as though CA is a really innovative
company.
> It's comparing apples to oranges. I've heard for nearly 15 years that COBOL
> is a dying language. It'll be here for a long time to come as it works and
> it's easy to learn and some places refuse to give it up. At one bank, I made
> the mistake of referring to one of the COBOL based databases as a legacy
> system. I only said it once.
Living life on the edge can be dangerous. Apparently, the new trendy
term is "heritage" systems. Soon, there'll be listed program status and
national program status that will allow these things to be saved for the
nation.
--
Charles F Hankel Wirral UK
------------------------------
Ready, Willing and (avail)Able
------------------------------
Date: 27 Aug 1998 17:24:14 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <6s44nu$q20$2@client3.news.psi.net>
Piers Cawley (pdcawley@bofh.org.uk) wrote on MDCCCXXII September MCMXCIII
in <URL: news:s7pu32yfr60.fsf@serinde.elsevier.nl>:
++
++ Now what do the panel think of:
++
++ $foo = $some_long_variable_name == value ?
++ $some_long_variable_name : $some_default
$foo = $some_long_variable_name == value ? $some_long_variable_name
: $some_default;
or, if the first line wouldn't fit:
$foo = $some_long_variable_name == value
? $some_long_variable_name
: $some_default;
++ I beginning to be of the opinion that there is no good way of
++ formatting this particular construct short of pulling it out into a
++ full on if .. else block.
Sure there is:
$foo = $some_long_variable_name;
$foo = $some_default unless $foo == value;
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
------------------------------
Date: 27 Aug 1998 17:20:03 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <6s44g3$q20$1@client3.news.psi.net>
Zenin (zenin@bawdycaste.org) wrote on MDCCCXXII September MCMXCIII in
<URL: news:904182512.42120@thrush.omix.com>:
++
++ Putting the flow control keywords at the end is problematic if
++ your conditions aren't very short:
++
++ if (
++ some condiontion and
++ cond2 and
++ some other condition that is long and
++ something and
++ yet another long condition or (
++ foo and
++ bar and
++ dog
++ )
++ ) {
++ code;
++ }
if (some condition &&
cond2 &&
some other condition that is long &&
something &&
yet another long condition ||
foo && bar && dog) {
code
}
or maybe:
if (some condition &&
cond2 &&
some other condition that is long &&
something &&
yet another long condition
||
foo && bar && dog) {
code
}
++ These I tend to pull out, but that's just me:
++
++ $win->sethook (
++ "hit" => sub {
++ my ($self, $window) = @_;
++ code;
++ },
++ );
$win -> sethook (
hit => sub {my ($self, $window) = @_;
code;},
);
Having "hit" start under the arrow, or the my under the "hit" looks
very rubbishly to me. And no quotes around hit.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: 27 Aug 1998 18:27:58 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <904242406.381660@thrush.omix.com>
Abigail <abigail@fnx.com> wrote:
: if (some condition &&
: cond2 &&
: some other condition that is long &&
: something &&
: yet another long condition ||
: foo && bar && dog) {
: code
: }
True, but this breaks my, "always stick the keyword/operator
on the far left if you can" rule.
Also, if there is a large, varied mix of long and short conditions
as above, I'm hitting indent quite a bit. If a change is made to a
long condition, it may often require that the operators of every
condition be realigned. This is the same school of thought that
shows comments like:
###############################
## Some comment ##
## with right end lines ##
###############################
aren't a good idea because if anything is changed the entire right
side of the comment must be realigned, which is a waste of time.
There is also the obvious problem of lining up the conditions with
the correct operator as there may/will be a large amout of white
space to get lost in. This is why the "table of contents" of many
books use a string of "..."s between the section and the page
number. It's just too easy to get lost and hit the wrong page
number, or in this case the wrong operator. Having them left
justified as keywords eliminates this problem completely.
: foo && bar && dog) {
: code
: }
I'll always hate this style. Granted, I used it when I first started
with Perl (my first C style language), but I never liked it then
either. The boundary between the code block and the massive condition
can't easily be read. A new line could be used, but that only lessons
the problem, not eliminates it. I haven't seen anything easier to read
then:
if (
...stuff...
foo && bar && dog
) {
code
}
: or maybe:
Same problems.
: $win -> sethook (
: hit => sub {my ($self, $window) = @_;
: code;},
: );
I never liked floating blocks like this. The start of the
block keyword is the 'hit', so IMHO the end of the block (the
right curly) should line up with it. Python uses floating
blocks for everything, IMHO much to its users loss.
The spacing of the -> is nice though, I may take that up, but
we'll see. -I want to look at more code to make sure it doesn't
confuse people into thinking $win isn't tightly bound to -> or
that sethook() might be a function not a method.
: Having "hit" start under the arrow, or the my under the "hit" looks
: very rubbishly to me.
That's just the way this one aligned. If $win was any longer this
wouldn't be a "problem". Random length indents however (as the 6
space indent you have for hit) are extremely anoying however. With
one option like this it isn't a big problem, but with many more
opitons it quickly gets very annoying. All indents and lineups
should fall on the same tab stops IMHO.
: And no quotes around hit.
Agreed. I just cut and pasted too fast. :-)
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Thu, 27 Aug 1998 11:42:35 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <MPG.104f48769788be879897fd@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <6s44nu$q20$2@client3.news.psi.net> on 27 Aug 1998 17:24:14
GMT, Abigail <abigail@fnx.com> says...
> Piers Cawley (pdcawley@bofh.org.uk) wrote on MDCCCXXII September MCMXCIII
> in <URL: news:s7pu32yfr60.fsf@serinde.elsevier.nl>:
...
> ++ I beginning to be of the opinion that there is no good way of
> ++ formatting this particular construct short of pulling it out into a
> ++ full on if .. else block.
>
> Sure there is:
>
> $foo = $some_long_variable_name;
> $foo = $some_default unless $foo == value;
Not very good if the first consequent is an expression with side effects.
--
(Yet Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 27 Aug 1998 18:48:53 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6s49ml$j0f$1@info.uah.edu>
In article <35E47639.9BF271E6@negia.net>,
Dan Boorstein <danboo@negia.net> writes:
: Greg Bacon wrote:
: > Please provide evidence for the claim that people who post from the
: > .edu TLD are rude and clueless.
:
: hmm, this sounds awfully familiar greg.
:
: s/the\n\.edu TLD/win32/
:
: i believe you've received this challenge previously and failed to
: produce any evidence except personal observation. considering the
: seriousness of the claim i find this unacceptable (as i do bob's claim).
: why is bob required to do that which you are not?
While I would love to clean your magnificent stables in one day, I
don't know of a river to redirect through them. Come on, Dan. Every
article carried by Usenet is required to contain a From: header.
This is not the case for X-Newsreader:.
I invite anyone who disbelieves to sit idly on EFNet #perl for at
most an hour. The great majority of FAQs and off-topic questions
will undoubtedly be from mIRC (a Win32 IRC client) users. If you
don't believe me, ask Chip or Randal or Tom or Nate or gnat or
anyone else who frequents #perl.
Greg
--
If you can't beat your computer at chess, try kickboxing.
------------------------------
Date: Thu, 27 Aug 1998 16:41:02 GMT
From: "Lee Davies" <lee.davies@NOSPAMsaaconsultants.com>
Subject: Compiled Perl for HP-UX 9.04?
Message-Id: <y_fF1.9489$bM3.293059@news-reader.bt.net>
Anyone know where I can download a compiled Perl for HP-UX 9.04?
Thanks.
------------------------------
Date: Thu, 27 Aug 1998 11:23:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Compiled Perl for HP-UX 9.04?
Message-Id: <MPG.104f4402c8a6c3e39897fb@nntp.hpl.hp.com>
In article <y_fF1.9489$bM3.293059@news-reader.bt.net> on Thu, 27 Aug 1998
16:41:02 GMT, Lee Davies <lee.davies@NOSPAMsaaconsultants.com> says...
> Anyone know where I can download a compiled Perl for HP-UX 9.04?
One place to look is this:
ftp://hpux.csc.liv.ac.uk/hpux/Languages/perl-5.004_04/
which is in the Software & Porting Archive for HP-UX. A couple of zipped
files are there, which I haven't looked at to see if they contain source
or binaries.
--
(Yet Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 27 Aug 1998 18:21:48 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Determining strlen
Message-Id: <0thF1.43$V5.321212@shore>
Michael J Gebis (gebis@fee.ecn.purdue.edu) wrote:
: Wouldn't it be cool if length could be an lvalue?
: length($str)=80;
Sounds like you need to subscribe to perl5-porters. :-)
--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>
------------------------------
Date: Thu, 27 Aug 1998 17:57:00 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Max value in an array
Message-Id: <8chfyyia02.fsf@gadget.cscaper.com>
>>>>> "Abigail" == Abigail <abigail@fnx.com> writes:
Abigail> map {} is your friend.
Abigail> Here's a Randal-happy version:
Uh, I think Abigail means that in reverse. :)
Abigail> sub max {
Abigail> return unless @_;
Abigail> my $max = shift;
Abigail> map {$max = $_ if $_ > $max; ()} @_;
Abigail> $max;
Abigail> }
Yup. map in a void context. Pure Evil.
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Thu, 27 Aug 1998 17:59:14 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Max value in an array
Message-Id: <8cemu2i9wc.fsf@gadget.cscaper.com>
>>>>> "Abigail" == Abigail <abigail@fnx.com> writes:
Abigail> map {} seems the exception
Abigail> on the rule that there are no lists in scalar context.
No, it's a list in a *void* context. I never have claimed that there
were no lists in a void context. :)
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 27 Aug 1998 18:20:17 GMT
From: "Saurus" <nonspammers.start.after.this.period.hot_redox@hotmail.com>
Subject: Misinterpreted => why no true/false keywords?
Message-Id: <01bdd1e7$4789b6a0$c1620c8a@lnxcompaq.lexis-nexis.com>
I think some readers have misinterpreted me (I wasn't
explicit enough).
Actually I think checking for the equality of
[ proposed ] true and false keywords in Perl should be
a compiler error, as in:
if ( $foo == true) { .... }). # wouldn't compile
However being able to say things like:
$Updated{'foo'} = true;
is more readable than saying:
$Updated{'foo'} = 1;
especially if maintaining other people's code (as I
am doing right now).
Saurus
[ Response directed towards several posters ]
------------------------------
Date: 27 Aug 1998 14:50:35 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Misinterpreted => why no true/false keywords?
Message-Id: <6s49pr$1rb$1@monet.op.net>
In article <01bdd1e7$4789b6a0$c1620c8a@lnxcompaq.lexis-nexis.com>,
Saurus <nonspammers.start.after.this.period.hot_redox@hotmail.com> wrote:
>However being able to say things like:
>
> $Updated{'foo'} = true;
>
>is more readable than saying:
>
> $Updated{'foo'} = 1;
Ah. But you can do that now. Install the following file as `booleans.pm';
package booleans;
sub import {
my $caller = caller;
*{$caller . '::true'} = sub () { 1 };
*{$caller . '::false'} = sub () { undef };
}
1;
Then in any file where you have said
use booleans;
you automatically have `true' and `false' constants, so that
$Updated{'foo'} = true;
works.
Of course, trying to use
if (my_func() == true) {
...
}
would be a gigantic mistake, but you said you didn't want to do that anyway.
------------------------------
Date: Thu, 27 Aug 1998 11:42:35 -0700
From: Prasad Suravarapu <psuravar@cisco.com>
Subject: Re: need and INI File parser in perl
Message-Id: <35E5A89B.725C@cisco.com>
John,
Actually, I did search CPAN before I posted here. The search didn't
seem to work well on random words like ini and config. It needed
module or author names etc. Someone's got to point me to the right
way to search for useful stuff on CPAN.
Thanks to Mike Stok <mike@stok.co.uk> for pointing me to the
right module.
-Prasad
John Porter wrote:
>
> Prasad Suravarapu wrote:
> >
> > If there is an INI type configuration file parser in perl,
> > I need it. Don't want to re-invent the wheel.
>
> Not reinventing the wheel is a good impulse.
> That impulse should trigger the following response: Check CPAN.
> You will find that you are in luck -- there is a module
> that does what you want.
>
> --
> John Porter
--
Prasad Suravarapu
Cisco Systems, Inc.
408-526-7997
------------------------------
Date: Thu, 27 Aug 1998 13:17:47 -0400
From: Misagh Ziaei <pepstud@nortel.ca>
Subject: newbie variable question...
Message-Id: <35E594BB.8BBD1CC8@nortel.ca>
Hello,
Here's a question: I have a variable, that is a path string. An
example...
$test = "/home/users/me/cool";
Is there a way I can strip away all the text except the 'me' part? I
mean, I want 'me' to be variable, but I don't want all the other
directories with it. And, under my circumstances, I don't think I can
make another variable or point to an existing one that might have 'me'.
I hope I was clear enough. Any help would be appreciated!
- Misagh
------------------------------
Date: Thu, 27 Aug 1998 17:47:36 GMT
From: jeanmar@my-dejanews.com
Subject: Perl calling Perl
Message-Id: <6s463o$q0c$1@nnrp1.dejanews.com>
Hi,
I'm trying to get a CGI-Lib Perl script call another Perl script that performs
some database queries and prints HTML on its standard output. The calling Perl
script needs to pass the output through to the browser.
I can get this to work on the command line but not through the browser.
The code fragment is:
eval `cat dbscript.pl`;
I need to call another script in order to be able to define the environment
(variables like LD_LIBRARY_PATH) before the script is called.
Thanks for your help,
JeanMarie
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Thu, 27 Aug 1998 18:13:13 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl compiler
Message-Id: <ZkhF1.39$V5.321212@shore>
Simon Wistow (simon@new-mediacom.com) wrote:
: As a newbie I've been watching this thread with a sort of horrid
: fascination.
Welcome to Usenet. :-)
: - Lily Fu asked about compiling her source code so no-one code read it
Yes.
: - Tom Christiansen went off on a bizarre diatribe about free speech and
: hoarding of information
Yes, but I don't think that it was bizarre.
: - Lily pointed out the reason she wanted to compile it was to hide the
: password she had in the script.
Yes.
: - somebody (wdr1@pobox.com (William D. Reardon) I think) made a
: reference to making the script not readable
Yes.
: - everyman and his job starting having a go at everyone
Not exactly. I think people were just pointing out the lameness of
plunking a cleartext password into a program and compiling the code in
hopes of sufficiently protecting the password. We were providing
information about the *risk(s)* of doing what Lily suggested.
: Before I'd done a course on compiler design I also would have thought
: compiling would have encrypted the password however now I know
: different. BUT NOT EVERYBODY DOES.
We were trying to educate. See above.
: And people wonder why the *nix community gets a reputation for being
: snobbish/elite-ist/arseholes.
This thread didn't have anything to do with Unix, me thinks. Why are
you coming to this conclusion?
: /simon dons asbestos suit and waits for the indignant flames and strange
: DoS attacks on his server.
Please apologize to the group for this!
--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>
------------------------------
Date: 27 Aug 1998 13:11:50 -0500
From: awdorrin@mail.delcoelect.com (Albert W. Dorrington)
Subject: Re: Perl compiler
Message-Id: <6s47h6$4s4@ws051eng.ictest.delcoelect.com>
In article <6rta8s$1t2$2@client3.news.psi.net>, abigail@fnx.com (Abigail) writes:
:> Craig Berry (cberry@cinenet.net) wrote on MDCCCXX September MCMXCIII in
:> <URL: news:6rt1jv$9fu$1@marina.cinenet.net>:
:> ++
:> ++
:> ++ Science is not a fair comparison. Science is (in the ideal sense) about
:> ++ the quest for Truth, for the secrets of the world in which we live. It
:> ++ strives toward a culture of openness and sharing. Perl is a tool used (by
:> ++ many -- or most -- of us) in our daily, grubby quest for money. We happen
:> ++ to love it, and enjoy using it, but money drives the process, by and
:> ++ large.
:>
:> Then don't come here for free advice on hiding your petty source code.
:> That makes you into a selfish person.
:>
Oh give me a break! There are many valid reasons for wanting
to keep source code hidden from users.
Most of the reasons I can think of off the top of my head
deal with security issues or support.
The real answer to the question: 'How can I hide/protect my
source code?' is - use another language, such as C, which
is compiled.
Of course there are other ways to do this with Perl. The
FAQ offers some suggestions.
The problem with not wanting people to read the code is
that they need to be able to read the code in order to
execute it.
One method I've used (on Unix systems) is to have a front-end
script/program which runs SUID. That front-end script then calls
the Perl script which is placed in a secure location, with the
proper permissions.
- Al
--
Al Dorrington
FIRMS & Web Admin, Oracle DBA Phone: 765-451-9655
IC-DELCO CIM, Delphi Delco Electronics Systems Fax: 765-451-8230
------------------------------
Date: 27 Aug 1998 18:50:56 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Perl compiler
Message-Id: <6s49qg$6eh$1@news.NERO.NET>
In article <TJ1F1.79$wf3.656465@shore>,
Nathan V. Patwardhan <nvp@shore.net> wrote:
>Russ Allbery (rra@stanford.edu) wrote:
>: While I generally agree with this, it's also the case that sooner or later
>: you'll have to do that or the equivalent, just because sooner or later
>: you'll need to deal with a password-authenticated system on an automated
>: basis.
>
>Using the terms password-authenticated and automated in the same
>sentence concerns me.
>
>Could you give a non-web example?
I have a really cool new server that has a whole computer that does
nothing but monitor the rest of the server. It wants a password before
it will let me get to the data. I want a log of the system
temperatures.
I need tide data on a daily basis. The dialup tide guage wants a
password.
I have several Annex terminal servers that need to have their serial
ports reset every so often or they get confused.
Now put all three examples in the user's context, where chown doesn't
work.
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 3563
**************************************