[9035] in Perl-Users-Digest
Perl-Users Digest, Issue: 2653 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 20 22:07:37 1998
Date: Wed, 20 May 98 19:00:31 -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 Wed, 20 May 1998 Volume: 8 Number: 2653
Today's topics:
Re: Bible References converted into Text <loyt@aals27.alcatel.com.au>
Re: Filename globbing strange behaviour <rootbeer@teleport.com>
Re: Flat-File db recommendation (Martien Verbruggen)
Re: Function syntax with prototyping, filehandles and a <webmaster@fccjmail.fccj.org>
Re: Function syntax with prototyping, filehandles and a <tchrist@mox.perl.com>
Re: Gif animations? <rootbeer@teleport.com>
GNU attacks on the open software community <tchrist@mox.perl.com>
Re: GNU attacks on the open software community <barmar@bbnplanet.com>
Re: GNU attacks on the open software community <bholzman@mail.earthlink.net>
Re: GNU attacks on the open software community <ak@muc.de>
Re: GNU attacks on the open software community (Chris Adams)
Re: Help on stripping a string (Martien Verbruggen)
Re: Help on stripping a string <playinmantis@earthlink.net>
Re: IN NEED OF AN EXAMPLE OF USING Win32::Registry (Martien Verbruggen)
Re: Perl unable to read a file on IIS <rootbeer@teleport.com>
Re: perl variables (Mike Stok)
Re: running scripts on multiple machines <rootbeer@teleport.com>
Re: Setuid and children <rootbeer@teleport.com>
Re: SNMP and Perl (Martien Verbruggen)
Re: Sourcing Unix environment file? (Martien Verbruggen)
Re: suid problem <rootbeer@teleport.com>
Re: translate A-Z to 1-26 <lr@hpl.hp.com>
Re: translate A-Z to 1-26 (Martien Verbruggen)
Re: writing image from http request to file <etiquet@sv.vtcom.fr>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 21 May 1998 11:08:31 +1000
From: Timothy Loy <loyt@aals27.alcatel.com.au>
Subject: Re: Bible References converted into Text
Message-Id: <9aogwsmnw0.fsf@aals27.alcatel.com.au>
"Arthur Gibbs" <nospam@aol.com>>really Gibbs at Cheerful.com> writes:
One question I have is that gospelcom or goshen must have some code.
Would they be able to share them?
I have been trying the same for a long time. I have got a working version
that is very messy and would like some comments too. The test reference I
have is :
gen1:1-10,15,13;3,5,6:3,Act3,5:5-6:3
features:
gen1:1-10 range in a chapter
15,13, individual verses (using last specified chapter)
;3,5 3 is recognised as a chapter because it is after a ';'
so the whole chapter 3 is listed
since 5 is after 3, it is also a chapter
6:3 individual verse of course
Act3 new book, one chapter
5:5-6:3 cross chapter ranges.
bugs: still cannot handle badly formatted queries like 3:,;:2
The code is still too bad to show on the net, but would certainly share a copy
if requested.
> Yes the problem is converting the references. 1 John 3:16-18,20 means 16
> through 18 and then 20 by itself. 1 John 3:16-17;4:1-2 means 16 through 17
> and then change to chapter 4 and get verses 1 through 2. And so on.
>
> I'm using the program to insert texts in graded Bible studies as it parses
> the html and sends it back. I already have a search program that can do
> simply 1 John 3:16-18 but nothing else. I just wanted to make sure I was
> the first to tackle this problem before I did.
>
> Thanks
>
> Arthur :)
>
> Current Flat File Database format:
> ---------------------------------
>
> 1:1 That which was from the beginning, which we have heard, which we have
> seen with our eyes, which we have looked upon, and our hands have handled,
--
Timothy Loy v
Access Systems Division A L C A T E L
-------------------------------------------------------------
mailto:Timothy.Loy@alcatel.com.au 61-2-9690 5540
------------------------------
Date: Thu, 21 May 1998 01:42:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: mdeira@my-dejanews.com
Subject: Re: Filename globbing strange behaviour
Message-Id: <Pine.GSO.3.96.980520182505.12546W-100000@user2.teleport.com>
On Wed, 20 May 1998 mdeira@my-dejanews.com wrote:
> Or should I not expect filename globbing as "ls -1" ?
You should not. You should basically get the same thing with a glob as you
get from typing 'echo ' and that glob on the command line.
@vitals = glob '*.c *.h Makefile';
That should always include Makefile. If you need other behavior, you may
use readdir and friends, or the -e filetest.
Incidentally, when I say that this is like typing that glob on the command
line, that's very true. Be careful what you glob.
@whuffo = glob 'foo ; echo "hello world"'; # may be interesting!
Of course, if that glob constructed from (say) input from a user, that
command didn't have to be so innocuous as an echo. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 21 May 1998 01:29:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Flat-File db recommendation
Message-Id: <6k000v$84r$1@comdyn.comdyn.com.au>
In article <6jvs9d$q1l$1@camel25.mindspring.com>,
"Bob Bacola" <bobbacola@pipeline.com> writes:
> This has probably been asked many times but is a RDBMS like MySQL required
> to search a large flat ascii file (43 megs, 136,000 rows) or does perl and
> or unix have enough built in power?
43 MB is not really that big. I routinely process log files that are
much bigger in perl. it all depends a bit on what you need to do and
how. If you need to treat that large file as a database, then I'd
advise you to get something to manage that, or maybe use the Sprite
modules which are available from CPAN (http://www.perl.com/CPAN).
Unix or perl won't have any problem with that size, if you have enough
memory etc. I doubt very much if NT's or Macs would have any problem
with it. The question, like I said before, is not the size of the
things, but more what you want to do with it.
> I currently search this file using the grep command in AIX 3.2.5
> which is very slow as you can imagine since it searches every
> character in the file. Could perl be setup to search by an index
> somehow?
perl, on itself, probably won't be faster than grep. But with the use
of indexes, sure, it will be faster. That's why indexes are used..
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Thu, 21 May 1998 01:46:07 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: Function syntax with prototyping, filehandles and arrays
Message-Id: <35638580.58F98D67@fccjmail.fccj.org>
Tom Christiansen wrote:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> Marc.Haber-usenet@gmx.de (Marc Haber) writes:
> :Are the prototypes really that different from the prototype concept we
> :know from other languages?
>
> Absolutely. Here's a Perl Cookbook draft excerpt.
>
> --tom
>
> Creating Function Prototypes
[snip]
How long before the Cookbook is a shipping book?
=)
-Sneex-
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster
------------------------------
Date: 21 May 1998 01:52:33 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Function syntax with prototyping, filehandles and arrays
Message-Id: <6k01d1$hq6$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, bill@astro.fccj.cc.fl.us writes:
:How long before the Cookbook is a shipping book?
We give the book to production a week from next Friday, so that it will
see print in time for the Perl Conference in August.
--tom
--
As Mike O'Dell once said, only half jokingly, "the most brilliant
decision in all of UNIX was the choice of a *single* character for
the newline sequence"...
------------------------------
Date: Thu, 21 May 1998 01:17:34 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Thomas Hafsaas <thafsaas@online.no>
Subject: Re: Gif animations?
Message-Id: <Pine.GSO.3.96.980520181718.12546U-100000@user2.teleport.com>
On Wed, 20 May 1998, Thomas Hafsaas wrote:
> Does anyone know of any gif animation tools libraries for perl?
If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-) Hope this helps!
http://www.perl.org/CPAN/
http://www.perl.com/CPAN/
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 21 May 1998 01:00:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: GNU attacks on the open software community
Message-Id: <6jvuc3$dg4$1@csnews.cs.colorado.edu>
[Also mailed to gnu et al.]
In http://www.gnu.org/prep/tasks_3.html you write the following:
We very urgently need documentation for some parts of the system that
already exist.
....
* A good free manual for Perl. (There are proprietary books,
but these are no good, because they are being withheld from our
community by their owners.)
What *are* you people talking about? The Perl manual is free. This is
either a gross misunderstanding, or a a vicious and devisive lie!
I certainly hope it's the former.
Why are you dividing our community? Why are you making trouble for
the people who are trying to do good. If you mean that your problem
is that Perl documentation is not public domain, neither is Perl, so I
don't understand your bitch.
If your bitching about my own copyright, let me review it for you:
Although destined for release as a manpage with the standard
Perl distribution, [perltoot] is not public domain (nor is any of Perl
and its docset: publishers beware). It's expected to someday
make its way into a revision of the Camel Book. While it is
* copyright by me with all rights reserved, permission is granted
* to freely distribute verbatim copies of this document provided
* that no modifications outside of formatting be made, and that
* this notice remain intact. You are permitted and encouraged
to use its code and derivatives thereof in your own source
code for fun or for profit as you see fit. But so help me,
if in six months I find some book out there with a hacked-up
version of this material in it claiming to be written by someone
else, I'll tell all the world that you're a jerk. Furthermore,
your lawyer will meet my lawyer (or O'Reilly's) over lunch to
arrange for you to receive your just desserts. Count on it.
That's right. You can't steal my stuff and lie about who wrote it,
or insert little bits saying "First, God created Boston" or any there
bogosities inside it. I give my stuff away. I simply don't want people
screwing it up, or lying about whose it is.
I have been driven to do this because people have stolen my work,
relabelled it as their own changing around little things like variables
names *and breaking the code and descriptions*, and then they went off and
sold it. This is a lie. It is disgusting theft of intellectual property;
it is a matter of honor and integrity not to misrepresent authorship.
Oh, and then they sued me for a million fricking bucks for my having
the audacity to notify their publisher that it was not original material
they were publishing.
Please do not tell me that you support such dishonesty. Actually,
do please tell me if such is the case. I think the world should know
one way or the other. I think they'd like to know about such Evil.
And I shall certainly be unbelievably vocal and active to spread the
word if in fact you reply that you are in support of misrepresentation,
theft, and dishonesty.
I really, really, *REALLY* hope that what you have written is a complete
misunderstanding, and that you will immediately remove the cited text
from your web page and similar documents now that you know that the Perl
documentation is free. There are 1,000 printed pages of free Perl
documentation. Get a duplex printer, make a 500-page book, give it
away for free or for your costs, and you will do us all a service.
No one is stopping you.
--tom
--
IBM: It may be slow, but it's hard to use.
- Andrew Tannenbaum <trb@ima.ima.isc.com>, author of Minix and Amoeba
------------------------------
Date: Thu, 21 May 1998 01:24:08 GMT
From: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: GNU attacks on the open software community
Message-Id: <YmL81.48$152.468270@cam-news-reader1.bbnplanet.com>
In article <6jvuc3$dg4$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>If your bitching about my own copyright, let me review it for you:
>
> Although destined for release as a manpage with the standard
> Perl distribution, [perltoot] is not public domain (nor is any of Perl
> and its docset: publishers beware). It's expected to someday
> make its way into a revision of the Camel Book. While it is
> * copyright by me with all rights reserved, permission is granted
> * to freely distribute verbatim copies of this document provided
> * that no modifications outside of formatting be made, and that
> * this notice remain intact. You are permitted and encouraged
> to use its code and derivatives thereof in your own source
> code for fun or for profit as you see fit. But so help me,
> if in six months I find some book out there with a hacked-up
> version of this material in it claiming to be written by someone
> else, I'll tell all the world that you're a jerk. Furthermore,
> your lawyer will meet my lawyer (or O'Reilly's) over lunch to
> arrange for you to receive your just desserts. Count on it.
>
>That's right. You can't steal my stuff and lie about who wrote it,
>or insert little bits saying "First, God created Boston" or any there
>bogosities inside it. I give my stuff away. I simply don't want people
>screwing it up, or lying about whose it is.
But what if someone makes a modification to perl, and then wants to make a
corresponding modification to the documentation? Your prohibition against
modifying the documentation requires them to distribute *incorrect*
documentation.
Anyway, but RMS's definition of "free", something is not free if he's not
free to modify it. The two most important freedoms he's working to promote
are the right to share software and the right to modify it.
--
Barry Margolin, barmar@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
------------------------------
Date: Wed, 20 May 1998 21:24:58 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: GNU attacks on the open software community
Message-Id: <3563826A.A7FF22AF@mail.earthlink.net>
> But what if someone makes a modification to perl, and then wants to make a
> corresponding modification to the documentation? Your prohibition against
> modifying the documentation requires them to distribute *incorrect*
> documentation.
>
> Anyway, but RMS's definition of "free", something is not free if he's not
> free to modify it. The two most important freedoms he's working to promote
> are the right to share software and the right to modify it.
Documentation is not software. If you make your own software based on
perl, I see no reason why you shouldn't write all your own
documentation. Nothing prevents you from doing that.
------------------------------
Date: 21 May 1998 03:51:24 +0200
From: Andi Kleen <ak@muc.de>
Subject: Re: GNU attacks on the open software community
Message-Id: <m33ee4mlwj.fsf@fred.muc.de>
Tom Christiansen <tchrist@mox.perl.com> writes:
> That's right. You can't steal my stuff and lie about who wrote it,
> or insert little bits saying "First, God created Boston" or any there
> bogosities inside it. I give my stuff away. I simply don't want people
> screwing it up, or lying about whose it is.
If I can't modify it it is not free.
-Andi
------------------------------
Date: 21 May 1998 01:57:31 GMT
From: cadams@ro.com (Chris Adams)
Subject: Re: GNU attacks on the open software community
Message-Id: <6k01mb$lpv$1@news.ro.com>
According to Tom Christiansen <tchrist@mox.perl.com>:
> * A good free manual for Perl. (There are proprietary books,
> but these are no good, because they are being withheld from our
> community by their owners.)
>
>What *are* you people talking about? The Perl manual is free. This is
>either a gross misunderstanding, or a a vicious and devisive lie!
>I certainly hope it's the former.
>
>
>Why are you dividing our community? Why are you making trouble for
>the people who are trying to do good. If you mean that your problem
>is that Perl documentation is not public domain, neither is Perl, so I
>don't understand your bitch.
A couple of years ago they attacked Linux, trying to rename it "Lignux",
and when that was blasted for stupidity, they wanted to call it
GNU/Linux. If they had wanted to be real and give credit where credit
was due, it would have been Linux/GNU/BSD/Perl/X/etc., but they wanted
GNU/Linux (GNU before Linux).
You mentioned the Camel book - that is a book from the evil O'Reilly
company (according to RMS). They are evil because they copyright their
books and don't give the rights to the FSF.
I don't think RMS will quit until every useable program in the world has
been signed over the the FSF.
--
Chris Adams - cadams@ro.com
System Administrator - Renaissance Internet Services
I don't speak for anybody but myself - that's enough trouble.
------------------------------
Date: 21 May 1998 01:01:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help on stripping a string
Message-Id: <6jvudk$824$1@comdyn.comdyn.com.au>
In article <356353D1.548A@dms2.com>,
Alee Ali <aaa@dms2.com> writes:
[snip]
> It is not properly working. If someone can help me with what I am doing
> wrong it will be greatly appreciated or suggest a better idea.
Of course, you are free to pursue the path you have chosen, and try to
do this yourself, but I just wanted to tell you that there is a module
out there that does exactly this for you: Text::ParseWords.
#!/usr/local/bin/perl -w
use strict;
use Text::ParseWords;
while (<DATA>)
{
chomp;
# Set the 0 to 1 if you don't want to keep the quotes
my @l = "ewords("[ +]", 0, $_);
print join(':', @l), "\n";
}
__DATA__
Perl Language
Perl+Language
"Perl Language"
"Perl Language" Misc
"Perl Language"+Misc
"Perl+Language" Misc
"Perl+Language"+Misc
OUTPUT
Perl:Language
Perl:Language
Perl Language
Perl Language:Misc
Perl Language:Misc
Perl+Language:Misc
Perl+Language:Misc
It's part of the standard distribution, so it should be installed
already. If it isn't, you can get it from http://www.perl.com/CPAN/
Documentation available with
# perldoc Text::ParseWords
If you don't want to use the module, you can at least look at the code
to see how it's done.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Wed, 20 May 1998 18:38:23 -0700
From: Matthew Purdon <playinmantis@earthlink.net>
To: aaa@dms2.com
Subject: Re: Help on stripping a string
Message-Id: <3563858F.62FD8BDE@earthlink.net>
--------------138E1049B8FE20C1D9AAC1CB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Alee Ali,
Run the following code.
--Matthew Purdon
#[Perl Language] I want it to become into 2 strings "Perl" and "Language".
#[Perl+Language] I want it become into 2 strings "Perl" and "Language".
#["Perl Language"] I want it to remain as "Perl Language".
#["Perl Language" Misc] I want it to become into 2 strings "Perl Language"
and "Misc".
#["Perl Language"+Misc] I want it to become into 2 strings "Perl Language"
and "Misc".
@string = ("Perl Language",
"Perl+Language",
"\"Perl Language\"",
"\"Perl Language\" Misc",
"\"Perl Language\"+Misc");
foreach $string (@string) {
if (index($string,"\"") == -1) {
$string =~ s/\+/ /;
@templist = split(/\s/,$string);
} elsif (index($string,"\" ") != -1) {
$string =~ /\"([a-zA-Z0-9]+\s+[a-zA-Z0-9]+)\"\s+([a-zA-Z0-9]+)/;
@templist = ($1,$2);
} else {
$string =~ s/\"//g;
@templist = split(/\+/,$string);
}
foreach $templist (@templist) {
push(@permlist,$templist);
}
}
# Test printout
foreach $permlist (@permlist) {
print "[$permlist]\n"; #results shown here
}
--------------138E1049B8FE20C1D9AAC1CB
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
<TT>Alee Ali,</TT><TT></TT>
<P><TT>Run the following code.</TT><TT></TT>
<P><TT>--Matthew Purdon</TT><TT></TT>
<P><TT>#[Perl Language] I want it to become into 2 strings "Perl" and "Language".</TT>
<BR><TT>#[Perl+Language] I want it become into 2 strings "Perl" and "Language".</TT>
<BR><TT>#["Perl Language"] I want it to remain as "Perl Language".</TT>
<BR><TT>#["Perl Language" Misc] I want it to become into 2 strings "Perl
Language" and "Misc".</TT>
<BR><TT>#["Perl Language"+Misc] I want it to become into 2 strings "Perl
Language" and "Misc".</TT><TT></TT>
<P><TT>@string = ("Perl Language",</TT>
<BR><TT> "Perl+Language",</TT>
<BR><TT> "\"Perl
Language\"",</TT>
<BR><TT> "\"Perl
Language\" Misc",</TT>
<BR><TT> "\"Perl
Language\"+Misc");</TT><TT></TT>
<P><TT>foreach $string (@string) {</TT>
<BR><TT> if (index($string,"\"") == -1) {</TT>
<BR><TT> $string =~ s/\+/ /;</TT>
<BR><TT> @templist = split(/\s/,$string);</TT>
<BR><TT> } elsif (index($string,"\" ") != -1) {</TT>
<BR><TT> $string =~ /\"([a-zA-Z0-9]+\s+[a-zA-Z0-9]+)\"\s+([a-zA-Z0-9]+)/;</TT>
<BR><TT> @templist = ($1,$2);</TT>
<BR><TT> } else {</TT>
<BR><TT> $string =~ s/\"//g;</TT>
<BR><TT> @templist = split(/\+/,$string);</TT>
<BR><TT> }</TT>
<BR><TT> foreach $templist (@templist) {</TT>
<BR><TT> push(@permlist,$templist);</TT>
<BR><TT> }</TT>
<BR><TT>}</TT><TT></TT>
<P><TT># Test printout</TT>
<BR><TT>foreach $permlist (@permlist) {</TT>
<BR><TT> print "[$permlist]\n"; #results shown here</TT>
<BR><TT>}</TT></HTML>
--------------138E1049B8FE20C1D9AAC1CB--
------------------------------
Date: 21 May 1998 00:40:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: IN NEED OF AN EXAMPLE OF USING Win32::Registry
Message-Id: <6jvt55$7so$2@comdyn.comdyn.com.au>
Please read the following information on how to choose a good subject
line:
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
In article <6jv5sh$3l8$1@nnrp1.dejanews.com>,
qvanegeren@frxsoft.com writes:
> Does anybody have an example of a script that uses the Win32::Registry
> module? I have tried to use the GetKey functionality, and I get no
There are examples in the libwin32 distribution.
..../libwin32-0.12/Registry/eg/*
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Thu, 21 May 1998 01:16:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: brabazon@blue.ocn.ne.jp
Subject: Re: Perl unable to read a file on IIS
Message-Id: <Pine.GSO.3.96.980520181307.12546T-100000@user2.teleport.com>
On Wed, 20 May 1998 brabazon@blue.ocn.ne.jp wrote:
> It seems to be open and the problem seems to be with the read.
Could it be that you need binmode? I don't think that's the case, but I
can't see what you're saying is the problem. Could you post a short
example program (around six lines) which shows what perl is doing that you
don't like? Of course, the example program shouldn't have to run over the
web.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 21 May 1998 01:30:49 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: perl variables
Message-Id: <6k0049$dll@news-central.tiac.net>
In article <6jvh3c$kin@bgtnsc03.worldnet.att.net>,
Jeff & Rebecca Jo Isom <jeffyjo-isom@worldnet.att.net> wrote:
>Mike Stok wrote:
>> In article <6jv9e8$23t@bgtnsc02.worldnet.att.net>,
>> Jeff & Rebecca Jo Isom <jeffyjo-isom@worldnet.att.net> wrote:
>> >Is there a way to check the contents of a variable to see if it contains
>> >a specific character?
>> >
>> >For example if I have a variable from a form that stores an email
>> >address and I want to make sure the variable contains a @. How would I
>> >accomplish this?
>>
>> One way to do it is to say
>>
>> if (index ($var, '@') >= $[) {
>> ...
>> }
>
>This actually needs to be
>
> if (index ($var, '@') <= $[) {
> ...
> }
>
>to work right
Why? If you're checking to see if a variable contains the @ then your
test seems off:
DB<3> $var = 'mike@stok.co.uk'
DB<4> print 'contains an @' if (index ($var, '@') >= $[)
contains an @
DB<5> print 'contains an @' if (index ($var, '@') <= $[)
DB<6>
Your test will return a true value if the variable either doesn't contain
an @ or contains an @ as the first character:
DB<6> $var = '@home'
DB<7> print 'contains an @' if (index ($var, '@') <= $[)
contains an @
DB<8> $var = 'none here'
DB<9> print 'contains an @' if (index ($var, '@') <= $[)
contains an @
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Thu, 21 May 1998 01:48:38 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Rick Bauman <rick@internetx.net>
Subject: Re: running scripts on multiple machines
Message-Id: <Pine.GSO.3.96.980520184737.12546Y-100000@user2.teleport.com>
On Wed, 20 May 1998, Rick Bauman wrote:
> I would like to be able to pass the values to
> other scripts, running on different machines and run them.
What's stopping you? :-) You may wish to see what perlipc says about
sending data from one machine to another. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 21 May 1998 01:03:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Paul Medynski <paulm@rc.gc.ca>
Subject: Re: Setuid and children
Message-Id: <Pine.GSO.3.96.980520175334.12546Q-100000@user2.teleport.com>
On Tue, 19 May 1998, Paul Medynski wrote:
> I've got a script that uses Net::Ping. I want to use icmp
> packets to ping with, but the script has to be run as root in order
> for icmp to work. The problem I have is that this script is a cgi
> (run by the web server) AND it calls other scripts using backquotes.
>
> I tried using the setuid bit (chmod +s) but Perl taints
> everything and I get Insecure $ENV{PATH} and $ENV{ENV}.
That's just Perl, working hard to save you from yourself.
> I tried setting these within the script before calling the other
> scripts, but that just gave me the message 'YOU DON'T HAVE SET-ID TURNED
> OFF IN YOUR KERNEL yada yada yada'.
Same thing; you need to find out why Perl is giving that message - if it's
right, your set-id scripts are a bomb waiting to blow. (If it's not, you
should recompile, at least.)
You could probably get this to work, if you fixed those two things, but
maybe you shouldn't. I don't recommend making a CGI script setuid to root,
if there's a way to avoid it.
Instead, perhaps you should make an external program which will do (only)
what you need, and make _that_ setuid to root. Then you may safely call
that program from your non-setuid program. In fact, you may be able to use
your system's own ping command to do this - it's already setuid to root,
and it should be safe. (Of course, there's extra overhead in launching
another process, but that time should be small compared to the time for a
typical ping, anyway.),
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 21 May 1998 00:44:51 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: SNMP and Perl
Message-Id: <6jvte3$7so$3@comdyn.comdyn.com.au>
In article <3562FC17.6824DF3B@hotmail.com>,
Default Shell User <cmeena@hotmail.com> writes:
> Is there any specific snmp library for perl.
# perl -MCPAN -e shell
cpan> i /SNMP/
Module Net::SNMP (Contact Author GBARR (Graham Barr))
Module SNMP (Contact Author GSM (Joe Marzot))
Alternatively, check out http://www.perl.com/CPAN/
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: 21 May 1998 00:51:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Sourcing Unix environment file?
Message-Id: <6jvtpn$7so$4@comdyn.comdyn.com.au>
In article <356345D6.7705@nortel.com>,
Thuy Nguyen <thuyn@nortel.com> writes:
> at the Unix prompt, one can type
>
> $ . /etc/navenv.d/DBSEnv
That of course, is specific to the shell one uses.
> I have tried using the system and exec commands, but none of it works.
> e.g
>
> $cmd = ". /etc/navenv.d/DBSEnv";
> system ($cmd);
There is no guarantee that this will use the same shell as the one you
are used to use. Even if there was, it would still not work, because
the command is not executed in the current shell, but in a child.
> Have anyone run into this problem before? And if you have, how would
> you resolve it? Any suggestions will be appreciated. Thank you.
By interpreting the file myself, and setting the appropriate %ENV
entries. Or maybe by wrapping the perl script in a shell script that
would do what you want before starting the perl script.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Thu, 21 May 1998 01:55:00 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Jochen Wiedmann <joe@ispsoft.de>
Subject: Re: suid problem
Message-Id: <Pine.GSO.3.96.980520185233.12546Z-100000@user2.teleport.com>
On Wed, 20 May 1998, Jochen Wiedmann wrote:
> I have a suid script that ought to administrate a set of text files.
> Any text file has a number of users associated with it that are
> allowed to modify the text file. The idea is that users may do a
>
> suidscript <filename>
>
> where suidscript checks whether the user is permitted to modify
> <filename> and if so, an editor is invoked.
>
> Problem is, that all these editors typically have escape sequences
> that allow to pass arbitrary commands to a shell: An obvious
> security hole.
>
> Any ideas how to fix this?
Write your own editor. :-)
Or, make a copy of the file, let them edit that (as their own userid),
then use that copy to update the original. This is basically what crontab
does to let an ordinary user edit their crontab file (on some systems).
Neglect not concurrency issues, though. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 20 May 1998 18:17:44 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: translate A-Z to 1-26
Message-Id: <6jvvc6$189@hplntx.hpl.hp.com>
Mark-Jason Dominus wrote in message <6js2le$gpd$1@monet.op.net>...
>
>In article <ltaf8fapzc.fsf@asfast.com>, Lloyd Zusman <ljz@asfast.com>
wrote:
>>But in EBCDIC, the set ('a' .. 'z') contains 41 elements.
>
>You'd think so, but according to this article, it contains 9.
>(_Perl and EBCDIC?_, Peter Prymmer, The Perl Journal, vol 2. no
>4. pp. 16-16)
That's pp. 16-18.
To quote from p. 18:
However, attempts to create a continuously collated list will simply
truncate at the EBCDIC punch card boundaries:
$ perl -e '@a=(a..z); for(@a) {print "$_ ";} print "<\n";'
a b c d e f g h i <
This list range truncation is unique to this particular port of EPCDIC
Perl and might not occur in future ports.
<END of QUOTE>
Love those barewords (a..z)! Don't try this with -w or use strict;
As I read that explanation, the truncation is a bug which would be
corrected, were there to be any future ports. :-)
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: 21 May 1998 01:30:51 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: translate A-Z to 1-26
Message-Id: <6k004b$84r$2@comdyn.comdyn.com.au>
In article <ltemxoe9r4.fsf@asfast.com>,
Lloyd Zusman <ljz@asfast.com> writes:
> mjd@op.net (Mark-Jason Dominus) writes:
>
>> You'd think so, but according to this article, it contains 9.
>> (_Perl and EBCDIC?_, Peter Prymmer, The Perl Journal, vol 2. no
>> 4. pp. 16-16)
>
> Does this article appear on line anywhere?
If it's online, you might find it at http://www.tpj.com/
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Thu, 21 May 1998 03:12:25 +0200
From: "Eric TIQUET" <etiquet@sv.vtcom.fr>
Subject: Re: writing image from http request to file
Message-Id: <6jvv0m$lnf@news.vtcom.fr>
If you don't need to manage firewall, you can try the win32::internet
package,
there is a lot of stuff to do upload and download in http or ftp.
You can found it somewhere in the faq at:
www.activeware.com
ERic TIQUET
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 2653
**************************************