[9520] in Perl-Users-Digest
Perl-Users Digest, Issue: 3114 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 10 05:07:32 1998
Date: Fri, 10 Jul 98 02:00:37 -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 Fri, 10 Jul 1998 Volume: 8 Number: 3114
Today's topics:
Re: -w on production code (was Re: better way of gettin (Craig Berry)
Re: -w on production code (was Re: better way of gettin <zenin@bawdycaste.org>
Re: -w on production code (was Re: better way of gettin (Tina Marie Holmboe)
Re: -w on production code (was Re: better way of gettin (Tina Marie Holmboe)
Re: -w on production code (Tina Marie Holmboe)
Re: Bug? shift( split(' ',$_)); won't compile. <qdtcall@esb.ericsson.se>
Re: Directory Names with Perl for NT (Larry Rosler)
HELP: Internet Database Design questions... <mozzer@earthlink.net>
Re: HELP: Internet Database Design questions... (-)
Re: How can you encrypt a CGI script on a server so it <zenin@bawdycaste.org>
Re: How can you encrypt a CGI script on a server so it <qdtcall@esb.ericsson.se>
Re: need to code a delete function <simonf@conduit.co.uk>
Re: need to code a delete function <zenin@bawdycaste.org>
Re: new charter and moderator for comp.lang.perl.announ (brian moore)
Re: new charter and moderator for comp.lang.perl.announ (Mark-Jason Dominus)
Re: new charter and moderator for comp.lang.perl.announ <rra@stanford.edu>
Re: new charter and moderator for comp.lang.perl.announ <rra@stanford.edu>
Re: parsing a template and replacing certain words (fro (Andy Wardley)
Re: pattern matching results into an array (Larry Rosler)
Perl security <jkinoshi@pcs.usp.br>
Perl security <jkinoshi@pcs.usp.br>
Re: Perl security <rra@stanford.edu>
Re: Placing output from System() call into an array fro (Tad McClellan)
Problem controlling smbclient via perl <rainer@demag.rwth-aachen.de>
Q: PGP <dmgl@dmgl.kirov.ru>
Re: Q: PGP (Neil Briscoe)
Re: Q:Switching Formats <rra@stanford.edu>
Re: secure HTTPS connection module? <douglas@home.com>
SQL INFORMIX DATABASE <edwardv@jps.net>
Re: trigger sending a Free Newsletter (-)
Trouble with ActiveState - urgent <ulf.wendel@kiel.netsurf.de>
Re: Turning off buffering <qdtcall@esb.ericsson.se>
Re: www.webresource.net (Tad McClellan)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 10 Jul 1998 05:15:50 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <6o4826$294$1@marina.cinenet.net>
Russ Allbery (rra@stanford.edu) wrote:
: Craig Berry <cberry@cinenet.net> writes:
:
: > Just possibly, some questions would not get asked, as people would be
: > forced to see the warnings explaining why their programs aren't behaving
: > as they expect.
:
: But. Please do not make Perl do things that annoy those of us who know
: how to use it in the name of making it easier for those who do not know
: how to use it. Down that path lies strong typing, mandatory warnings,
: bondage and discipline languages, and C++.
Mine was not an advocacy post. Rather, I was responding to a posed
thought experiment. I agree that making -w the default is the wrong
direction for Perl to take. However, don't go bad-mouthing C++; I love
it, too, for different reasons, and in different applications.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 10 Jul 1998 07:18:14 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <900055630.760582@thrush.omix.com>
Craig Berry <cberry@cinenet.net> wrote:
>snip<
: Mine was not an advocacy post. Rather, I was responding to a posed
: thought experiment. I agree that making -w the default is the wrong
: direction for Perl to take. However, don't go bad-mouthing C++; I love
: it, too, for different reasons, and in different applications.
Ok, you're the second person that I've heard say, "I love it" in
reference to C++.
Do I hear a third? Anyone? Buller...Buller?
J/K :-)
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: 10 Jul 1998 08:35:33 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <6o4jol$8o4$4@news1.sol.no>
In article <6o2q10$duh$1@client3.news.psi.net>,
abigail@fnx.com (Abigail) writes:
> ++ *Lots* of our new programmers do that. But they don't add -w to their
> ++ *development* code.
>
> You need better guidelines, and a QA system.
No shit, Sherlock!
And that answer of yours will certainly fix aaaaall my problems with
overflowing logs during today, tomorrow, and the next 2 years whilst
they get around to *getting* what you describe above.
Great answer. Good solution. Very down-to-earth like... yup.
--
Tina Marie Holmboe
Systems Programmer (Geeks'R'Us) [tina@tech.scandinaviaonline.se]
WebMaster [webmaster@scandinaviaonline.se]
Scandinavia Online AB Development Dept. (+46) 08 587 81000 (switchboard)
(+46) 08 587 81189 (direct)
------------------------------
Date: 10 Jul 1998 08:38:59 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <6o4jv3$8o4$5@news1.sol.no>
In article <35A5600C.D5A90788@shaw.wave.ca>,
Rick Delaney <rick.delaney@shaw.wave.ca> writes:
> If wading through the error log is what's mainly bugging you, why not
> just make a perl script that will filter out junk that's not yours.
> Better yet, a script that reads the log and e-mails the warnings to
> their owner every night.
That would be a good idea - if I were allowed to access the logs through
any other means than a CGI-script running on a HTTPS server; a script
that presents the last 2000 lines of the log.
A nicely placed -w can easily flood those 2000 lines... and I have no
other means of accessing the log. Yep, its true. Very... flexible,
see ?
> Just a suggestion. (But you might prefer to keep your friends :-)
>:)
--
Tina Marie Holmboe
Systems Programmer (Geeks'R'Us) [tina@tech.scandinaviaonline.se]
WebMaster [webmaster@scandinaviaonline.se]
Scandinavia Online AB Development Dept. (+46) 08 587 81000 (switchboard)
(+46) 08 587 81189 (direct)
------------------------------
Date: 10 Jul 1998 08:32:42 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: -w on production code
Message-Id: <6o4jja$8o4$3@news1.sol.no>
In article <35a4ed78.696185772@news.mr.net>,
Scott.L.Erickson@HealthPartners.com (Scott Erickson) writes:
>>++ a) System programmer or system admin installs a new module.
>>++ b) The module sprouts warnings.
>>++ c) I used -w
>>++ d) I can't bloody debug my own script due to screefuls of warnings
>>++ from the *module*
>>++ e) I ask them to do something about the module
>>++ f) I am told to go fuck myself
>>
>> g) Don't use the module.
>
> I have to agree with Abigail on this one. I encountered a similar
The situation isn't that simple - as Abigail sadly will never quite
catch I guess.
g) Don't use the module
h) Get fired
('H' is abit overdone here, but perhaps it rings a bell in certain
quarters)
When one has *mandatory* modules one has no choice but either to use
or get shit about *not* using; one use - and hope that things hold
together. And kick a few ass for using -w to flood logs...
> use strict, the code still generated error messages. His response was
> "well it is in production and I am not going to change it." So, I
> wrote own code and now I do not get error messages. It was that
Which I also do - it isn't a black and white picture I painted, after
all. Sadly there *are* modules I am not *allowed* to touch, and *required*
to use.
The world simply doesn't work in the fashion of statements like:
"Sysadm won't upgrade from Perl 4 ? Fire him!"
"Modules are too old ? Well, install the new ones!"
So... *shrugs* -w is a nice set of training wheels. But that, IMHO, is
also all that they are. I use "perl -cw" to test my code. I occationally
use #! /something/perl -T ... I never use -w.
I'll probably rot in some Perl'ers private hell for that, but so be it.
I'll keep saying that warnings from -w should be caught earlier in the
coding cycle, and that a -w subsequently could, and should, be left out
of production code. Not only will it - in CGI context - fill logs with
things that really don't matter at the time, but it'll confused clients
who can't make use of it anyway. Many good points made by others to this
effect.
--
Tina Marie Holmboe
Systems Programmer (Geeks'R'Us) [tina@tech.scandinaviaonline.se]
WebMaster [webmaster@scandinaviaonline.se]
Scandinavia Online AB Development Dept. (+46) 08 587 81000 (switchboard)
(+46) 08 587 81189 (direct)
------------------------------
Date: 10 Jul 1998 10:56:54 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Bug? shift( split(' ',$_)); won't compile.
Message-Id: <islnq2m6cp.fsf@godzilla.kiere.ericsson.se>
postmaster <"postmaster"@[127.0.0.1]> writes:
> Is this actually a bug or am I missing something?
Could you please clarify which bit you thought was the bug? All I saw
was perfectly reasonable.
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: Thu, 9 Jul 1998 22:43:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Directory Names with Perl for NT
Message-Id: <MPG.100f49d2f013915d98972c@nntp.hpl.hp.com>
In article <6o43gk$q0p@fumnix.metronet.com> on 9 Jul 1998 22:58:12 -0500,
Tye McQueen <tye@fumnix.metronet.com> says...
...
> system( "xcopy /hekq ", join(" ",quote_files($source,$dest)) );
>
> sub quote_files {
> my( @files )= @_;
> my $file;
> foreach $file ( @files ) {
> # If file name contains things that require quoting
> # and isn't already enclosed in quotes:
> if( $file =~ /["\s<>&]/ && $file !~ /^".*"$/ ) {
It is somewhat simpler than that, because the characters " < > are not
permitted in Windows/DOS filenames at all [nor are several other
punctuation characters, quite unlike Unix -- the other characters are * +
, ; : = ? [ \ ] | ]. This is a little-publicized portability trap.
> # Turn <This is "my" file name>
> # into <"This is ""my"" file name">:
> $file =~ s/"/""/g;
So this protection is superfluous also.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 08 Jul 1998 23:32:12 -0700
From: Avi Goldenberg <mozzer@earthlink.net>
Subject: HELP: Internet Database Design questions...
Message-Id: <35A463EC.365436B8@earthlink.net>
Hi...
*sigh* For being someone who though they were technically competent, I
am suddenly humbled into a quivering child!
I need some help understanding (or at least pointed towards a great text
or two on) a good approach towards setting up a web site that has
interactive database abilities.
My current problems are that I don't know:
* What technologies are need today or are currently used
* What hosting setup do I need that will give me the capabilities to
perform
* What is a good book (text) to help me get a grip on this!
My initial goal is simply to design a few pages that accept information
via forms, store it, and will use simple search and retrieval functions
to re-display stored data in various forms.
If someone can PLEASE email me and mentioned a good book or two to
discuss the technologies I need to learn, I would _really_ appreciate
it. At the least, if someone could answer:
1) What are the current technologies needed to achieve the minimum of
data storage, retrieval, and manipulation? (I prefer to stay NT as
opposed to UNIX)
2) What do I need to look for in a hosting service to allow me to
achieve #1?
THANKS in advance!
mozzer@earthlink.net
------------------------------
Date: Fri, 10 Jul 1998 07:27:55 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: HELP: Internet Database Design questions...
Message-Id: <35a5bfa8.36556343@nntp.idsonline.com>
Avi Goldenberg <mozzer@earthlink.net> Said this:
>I need some help understanding (or at least pointed towards a great text
>or two on) a good approach towards setting up a web site that has
>interactive database abilities.
>
>My current problems are that I don't know:
>* What technologies are need today or are currently used
>* What hosting setup do I need that will give me the capabilities to
>perform
>* What is a good book (text) to help me get a grip on this!
New Riders has a book called "Building Internet database servers with
CGI" it has quite a few example setups. It also deals with a little
bit of the "theory" behind web based database servers and databases in
general.
ISBN 1-56205-575-5
>
>My initial goal is simply to design a few pages that accept information
>via forms, store it, and will use simple search and retrieval functions
>to re-display stored data in various forms.
You can make your own database then.... simple flat text files, comma
seperated (or better, caret ^ seperated).
I'm using perl to search a 20 megabyte flat text file of compact disc
titles, and it's actually pretty damn quick, considering the size of
the file and the size of each record.
>
>If someone can PLEASE email me and mentioned a good book or two to
>discuss the technologies I need to learn, I would _really_ appreciate
>it. At the least, if someone could answer:
>
>1) What are the current technologies needed to achieve the minimum of
>data storage, retrieval, and manipulation? (I prefer to stay NT as
>opposed to UNIX)
Well, NT is going to be your biggest problem, but that's another
story. I suppose I should have figured you were using NT by the fact
that you needed to ask this question in the first place. NT is for
non-skilled computer users, if you weren't aware.
I would suggest using unix unless for some god-awful reason you
already have the database running on NT and is being accessed by
internal users as well. I'd suggest converting it to a unix-based
DBM, but that's just because I can't stomach all the system downtime
and poor performance of NT. Unix runs better, almost never crashes
(I've got unixx machines that have never crashed, and they've been
running continuously for over 2 years), and has far better support
overall than anything microsoft passes off as "software".
>2) What do I need to look for in a hosting service to allow me to
>achieve #1?
>
For "small scale" stuff, you can use a perl based search interface to
flat text files, so all you'd need is cgi execute ability and a
directory to call your own on a web server. If you want to get into
"larger scale", then build yourself a rack-mountable pentium pro or
pentium II machine, load linux on it, and then add miniSQL and WDB or
one of the other "database-to-web gateways", and find an ISP in your
area who provides "co-location". I pay $250 a month. With
co-location, your machine is it's own network, you can run your own
mailserver, web server, DNS, and whatever else.
------------------------------
Date: 10 Jul 1998 07:24:15 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: How can you encrypt a CGI script on a server so it will not get "stolen"?
Message-Id: <900055991.854512@thrush.omix.com>
John Layne <jpl@lanl.gov> wrote:
: I have spent many, many hours writing a CGI script that creates a
: client's web site from a text file on the server. I am worried because
: there is nothing to prevent this client from copying the plain-text
: script, firing me as their web developer, and getting someone else to
: use the script. I have made it clear that the scripts belong to me and
: they pay to use them. But...
## COPYRIGHT (c) 1998 John Layne
## All rights reserved.
See /bin/true on SysV machines for a more detailed example.
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: 10 Jul 1998 10:17:26 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: How can you encrypt a CGI script on a server so it will not get "stolen"?
Message-Id: <isu34qm86h.fsf@godzilla.kiere.ericsson.se>
John Layne <jpl@lanl.gov> writes:
> I am worried because there is nothing to prevent this client from
> copying the plain-text script, firing me as their web developer, and
> getting someone else to use the script.
Yes there is. It's called "the Law". If you have written the program,
you own the rights to it (unless you were working under a contract
saying otherwise).
> What would be the best way to protect my assets?
A lawyer. Maybe the police, depending on circumstances.
> Any ideas would be gratefully accepted. I would imagine that this is
> an issue others have faced.
If you thought that far, why didn't you check the FAQ? Your question
is in part 3, near the middle.
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: Fri, 10 Jul 1998 08:56:39 +0100
From: "Simon Fairey" <simonf@conduit.co.uk>
Subject: Re: need to code a delete function
Message-Id: <35a5c868.0@nnrp1.news.uk.psi.net>
Um are you trying to delete just one file or actual lines from a file
(apologies if I am being stupid) but it is not 100% clear. If you are just
trying to delete a given file then make sure you have sufficient privilege
(I assume you will do as you created it in the first place) and that the
path is correct you might want to try adding a check after the unlink; its
always good practice.
unlink $filename or die "Unable to delete $filename: $!";
Simon
Doug Perry a.k.a drperry wrote in message
<35a595d9.9397133@news.greennet.net>...
>This is driving me nutz! I have a nice content mangement tool that I
>out together to teach myself CGI/perl. So far I have a script to parse
>and write a datafile and one to display the data in a Web page. The
>funny thing is that I still haven't figured out a way to delete all
>the entries at once. Dumb me, I tried the brute force way:
>unlink("FILENAME"). It worked but it caused one big 500 http error.
>What would be nice is some guidance towards a way to delete all the
>entries in a datafile at once without the 500 errors.
------------------------------
Date: 10 Jul 1998 08:10:05 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: need to code a delete function
Message-Id: <900058742.357974@thrush.omix.com>
Doug Perry a.k.a drperry <drperry@greennet.net> wrote:
: This is driving me nutz! I have a nice content mangement tool that I
: out together to teach myself CGI/perl.
perldoc CGI
If that doesn't help enough, show us the code you're using,
your datafile format, the exact error messages your getting,
and probably most importantly where you've looked already for
more information (man pages, etc) and what you didn't understand
about them.
Hope this helps!
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: 10 Jul 1998 05:33:38 GMT
From: bem@news.cmc.net (brian moore)
Subject: Re: new charter and moderator for comp.lang.perl.announce
Message-Id: <slrn6qb9tt.4es.bem@thorin.cmc.net>
On 9 Jul 1998 17:15:42 GMT,
John Erjavec V <jev@newton.pconline.com> wrote:
> One problem with having a loose charter, and letting the moderator decide
> what should and should not go into the group is the matter of legal action.
> People have been taken to court over their decisions on what to let
> through, and what to reject. If the charter can back up the decisions, it
> would either be easier to defend against legal action, or legal action
> might not be taken. If it is just a matter of "I think this should go
> through, and this shouldn't", no matter how benevolent and full of Wisdom
> the moderator, there will be people that are pissed that their announcement
> was rejected, and an announcement that they feel is similar was posted.
> These people are the ones that might take legal action, and these are the
> ones that a strong charter would help protect the moderator against.
Well, there is no legal basis for such claims. The moderator(s) of a
group are the publishers. You can't sue the NYTimes because they
reviewed the latest Grisham book, but didn't even list yours in the
lists of what was published. (Well, I guess you can, but a no sane
lawyer would take the case.)
Certainly a moderator could be sued for publishing
defamatory/libelous/etc material (cf Prodigy), but I don't see a lot of
"use Widget::Gonzo because the Foo::Bar author wets the bed!" sort of
stuff in clpa, and I don't think it's the sort of thing likely to get
approved.... commercial or not.
--
Brian Moore Kill A Spammer For Jesus
Sysadmin, C/Perl Hacker, Usenet Vandal
------------------------------
Date: 10 Jul 1998 01:40:51 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: new charter and moderator for comp.lang.perl.announce
Message-Id: <6o49h3$8kk$1@monet.op.net>
In article <6o2tru$lgk$1@bell.pconline.com>,
John Erjavec V <jev@newton.pconline.com> wrote:
>People have been taken to court over their decisions on what to let
>through, and what to reject.
Cite, please?
------------------------------
Date: 09 Jul 1998 23:17:03 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: new charter and moderator for comp.lang.perl.announce
Message-Id: <m31zrunsbk.fsf@windlord.Stanford.EDU>
Martien Verbruggen <mgjv@comdyn.com.au> writes:
> groenvel@cse.psu.edu (John D Groenveld) writes:
>> Let the commercial interests advertise in the Perl Journal or some
>> other median.
> Now, this is an idea I like.
In my opinion, Usenet is intended for discussion and announcement of
things of interest to its readers. If those things of interest happen to
be commercial, so be it; that doesn't disqualify them. The key point here
is that the things have to be of interest to the readers, *not* things
that the company thinks the readers will be interested in.
Vital difference.
There is no possible substitute here for moderator judgement. If Randal
doesn't want to exercise that judgement, for reasons that I consider
entirely understandable, then can I recommend that he find a comoderator
who is willing to do so and simply bounce everything he finds questionable
in terms of commercial content to that comoderator to deal with?
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 09 Jul 1998 23:35:42 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: new charter and moderator for comp.lang.perl.announce
Message-Id: <m3emvumcw1.fsf@windlord.Stanford.EDU>
Mark-Jason Dominus <mjd@op.net> writes:
> John Erjavec V <jev@newton.pconline.com> wrote:
>> People have been taken to court over their decisions on what to let
>> through, and what to reject.
> Cite, please?
Yes, I'd be *very* interested to hear this, since if this is the case the
moderators mailing list almost certainly has not heard about it, nor has
anyone that I know who's involved in the Big Eight newsgroup creation
process.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Fri, 10 Jul 1998 07:37:54 GMT
From: abw@cre.canon.co.uk (Andy Wardley)
Subject: Re: parsing a template and replacing certain words (from a form)
Message-Id: <EvvBv7.LA8@cre.canon.co.uk>
<jevon@my-dejanews.com> wrote:
>I am trying to parse through a template and then replace all instances of
>$name with it corresponding $value ($name[5] = $value[5] etc...) This is my
>code.
[...snip...]
>I know it's messy and I am not used to perl. But I am having a lot of trouble
>getting this to work.. could someone sujest ANYTHING...
Have a look at Text::Template. It does variable substitution for you.
If you need something more heavy duty then you might want to look at
Text::MetaText or one of the other many templating modules available
from CPAN.
A
--
Andy Wardley <abw@kfs.org> Signature regenerating. Please remain seated.
<abw@cre.canon.co.uk> For a good time: http://www.kfs.org/~abw/
------------------------------
Date: Thu, 9 Jul 1998 22:30:50 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: pattern matching results into an array
Message-Id: <MPG.100f46e9c6aa8e0898972b@nntp.hpl.hp.com>
In article <eli$9807092309@qz.little-neck.ny.us> on 10 Jul 1998 03:16:45
GMT, Eli the Bearded <*@qz.to> says...
> In comp.lang.perl.misc, <Juli@my-dejanews.com> wrote:
...
> > while ($line = <BOOK>) {
>
> A line like "0\n" would confuse this, use:
No, because that value for $line evaluates to TRUE. The thing that would
confuse it would be a "line" like "0" which can occur at the end of the
file only. Weird, eh?
> while (defined($line = <BOOK>)) {
>
> Newer versions of perl will warn about this with -w.
For some value of 'newer' -- specifically 5.004. I understand that perl
5.005 will treat these two constructions identically, so the warning will
go away. None too soon, IMHO.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 10 Jul 1998 00:03:59 -0400
From: Jorge Kinoshita <jkinoshi@pcs.usp.br>
Subject: Perl security
Message-Id: <35A592AF.C7F12805@pcs.usp.br>
Hello everybody,
I heard that Perl CGI scripts have some holes in security. I would
like to know about these holes in security and how to avoid them. I
appreciate any help. I did not find anything about it in the normal
literature I have read (OReylleys books). Thanks.
------------------------------
Date: Thu, 09 Jul 1998 23:55:03 -0400
From: Jorge Kinoshita <jkinoshi@pcs.usp.br>
Subject: Perl security
Message-Id: <35A59097.DBBE167@pcs.usp.br>
Hello everybody,
I heard that Perl CGI scripts have some holes in security. I would
like to know about these holes in security and how to avoid them. I
appreciate any help. I did not find anything about it in the normal
literature I have read (OReylleys books). Thanks.
------------------------------
Date: 10 Jul 1998 01:11:47 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl security
Message-Id: <m33ecaktvg.fsf@windlord.Stanford.EDU>
Jorge Kinoshita <jkinoshi@pcs.usp.br> writes:
> I heard that Perl CGI scripts have some holes in security.
The statement as phrased is overly general to the point of being nonsense.
A CGI script is no more or less secure solely because it's written in Perl
rather than some other programming language. However, Perl does provide
you with many tools to help make your script more secure, and modules that
can handle incoming data in a secure fashion.
> I would like to know about these holes in security and how to avoid
> them.
See man perlsec.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 9 Jul 1998 23:42:51 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Placing output from System() call into an array from the file that calls it?
Message-Id: <b464o6.ea4.ln@localhost>
Bryan T Hoch (bth@acsu.buffalo.edu) wrote:
: In one of my Perl programs, I have a line that calls a system call to see
: who is on line.
: if ((system ("rusers -l $hostA | fgrep $personA")) == 0){
^^^^^^
^^^^^^
: }
: Right now, what it does is just spit out every single user on $hostA to
: the screen (it doesn't take into account it's only looking for $personA.
: How do I make it so it doesn't print it to the screen (rather to an array
: or string in the program)
You open up the 'perlfunc' man page that is on your hard disk
and read about the function that you are having trouble with
(the one I underlined above).
Where it says, in the very first paragraph:
"This is NOT what you want to use to capture
the output from a command, for that you should use ..."
Go see. Learn. Live long and prosper.
: and how do I do it so it only checks for
: $personA, and not everyone on that host?
You type:
perldoc -f grep
(this is perl's internal grep(), not the grep you were using above)
: Thanks a lot to anyone who tries to help.
Thanks a lot to anyone who makes some small attempt to answer their
questions themselves before posting to thousands of computers around
the world.
(
Sorry for getting cheeky.
But you *know* that system() isn't doing what you want.
Yet you didn't read the documentation for system() that was
written by the very folks that created the function itself.
If you had done that, you could have had the answer to your
question is *less time* than it took you to *type* your post!!!
Sheesh...
)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 10 Jul 1998 10:20:06 +0200
From: Rainer Finocchiaro <rainer@demag.rwth-aachen.de>
Subject: Problem controlling smbclient via perl
Message-Id: <35A5CEB6.4484AEB6@demag.rwth-aachen.de>
Hi all,
I want to fetch the list of logged-in users from our NT domain server.
As it should be done on a regular basis (every ten minutes) I want it to
run without interaction, started by crond.
On the command line it works like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vanadium:[rainer] >smbclient -L domainserver.domain.de
Added interface ip=xxx.xxx.xxx.xxx bcast=xxx.xxx.xxx.xxx
nmask=255.255.252.0
Server time is Fri Jul 10 10:06:33 1998
Timezone is UTC+2.0
Password: #here I have to press <RETURN> (no password needed)
Domain=[DEMAG] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0]
security=user
This machine has a browse list:
Server Comment
--------- -------
....... .......
This machine has a workgroup list:
Workgroup Master
--------- -------
....... .......
vanadium:[rainer] >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I tried it with this script:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/usr/bin/perl
open(PROC, '| smbclient -L domainserver > /tmp/browse.pup');
print PROC "\n";
close PROC;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
But it somehow waits for me to press <RETURN> (if started from the
commandline).
Does anyone have an idea, as to where the problem might be?
Thanks in advance for any hint
Rainer
--
Rainer Finocchiaro
Hainbuchenstr. 2
52072 Aachen
Deutschland
Email: rainer@demag.rwth-aachen.de
Talk: rainer@vanadium.demag.rwth-aachen.de
------------------------------
Date: Fri, 10 Jul 1998 09:05:22 +0400
From: "D" <dmgl@dmgl.kirov.ru>
Subject: Q: PGP
Message-Id: <35a5a0da.0@rapeme.kirov.ru>
How can I find instruction on using PGP and Cryptix on Perl?
Thanks in advance
------------------------------
Date: Fri, 10 Jul 1998 9:27 +0100 (BST)
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: Q: PGP
Message-Id: <memo.19980710092733.36399D@skep.compulink.co.uk.cix.co.uk>
In article <35a5a0da.0@rapeme.kirov.ru>, dmgl@dmgl.kirov.ru (D) wrote:
> How can I find instruction on using PGP and Cryptix on Perl?
>
I don't know what Cryptix is, but theres certainly a module on CPAN for
working with PGP. If memory serves its pgp03a - so an alpha module - but
I've used it successfully with pgp 2.6.3i and it works just fine.
Regards
Neil
------------------------------
Date: 09 Jul 1998 23:14:24 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Q:Switching Formats
Message-Id: <m34swqnsfz.fsf@windlord.Stanford.EDU>
"Kirby, David" <davidkirby@nmcc.sprintspectrum.com> writes:
> How can I get my format header to print after switching formats mid-page
> (instead of waiting for TOP)? TIA!
The section on write in man perlform has this to say:
Top of form processing is handled automatically: if there is
insufficient room on the current page for the formatted record,
the page is advanced by writing a form feed, a special top-of-
page format is used to format the new page header, and then the
record is written. By default the top-of-page format is the name
of the filehandle with "_TOP" appended, but it may be
dynamically set to the format of your choice by assigning the
name to the `$^' variable while the filehandle is selected. The
number of lines remaining on the current page is in variable `$-
', which can be set to 0 to force a new page.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Fri, 10 Jul 1998 06:34:22 GMT
From: Douglas Galbraith <douglas@home.com>
Subject: Re: secure HTTPS connection module?
Message-Id: <35A5B5C7.2114FEB@home.com>
Thanks Gisle,
I tried your code addition, and got the following output:
"404 Not found"
So at least I'm now getting something out (now if I can just figure out
what it means).
Unfortunately, I'm new to the whole perl installation process. I
downloaded the ActiveWare stuff for Windows95. Below is my system info:
system: Windows95 (4.00.950a)
perl version: perl 5.00469 beta
perl download: http://www.activestate.com/ActivePerl/download.htm
I grep'ed the perl directory tree and found one reference to
"Crypt-SSLeay" locate in:
c:/perl/site/5~1.004/lib/lwp/protocol/https.pm:require Net::SSL; #
from Crypt-SSLeay
I therefore *assume* that the proper libraries were included with the
ActiveWare installation, and that I'm just using them wrong.
If you have any suggestions on what I'm doing wrong, or on where I can
get myself educated on library installation and referencing, I'd
appreciate the help. (I'm presently digesting the htm pages included
with the installation, but haven't yet found a list of all the library
macros, where they are located, and how to specifically access each
one. It must be there somewhere, and I'm probably staring right at it
and just don't realize it yet.)
Thanks for any help,
DGalbra862
Gisle Aas wrote:
>
> Douglas Galbraith <douglas@home.com> writes:
>
> > Is there a module specifically used for HTTPS connections? (I've
> > grep'ed the doc html pages, and can't find anything.)
> >
> > I've tried the script below, and "$content" is always empty. I've tried
> > several secure sites, and gotten the same results (but when I've tried
> > this url with a browser, I DO get a response).
>
> The program works for me. Do you have SSLeay installed on your
> machine? The LWP README says:
>
> If you want to access sites using the https protocol, then you need to
> install the Crypt-SSLeay modules first. (The Net::SSLeay module is not
> supported any more.)
>
> > #!/usr/bin/perl -w
> > use LWP::UserAgent;
> >
> > $ua = LWP::UserAgent->new;
> > $request = HTTP::Request->new(GET =>
> > 'https://trading27.schwab.com/trading/miniquote?QuotesSecurityName=IBM');
> > $response = $ua->request($request);
> > $content = $response->content();
> > print $content . "\n";
>
> Might be a good idea to check the outcome of the request:
>
> if ($response->is_success) {
> print $response->content;
> } else {
> print $response->status_line, "\n";
> }
>
> --
> Gisle Aas
------------------------------
Date: Thu, 9 Jul 1998 23:16:12 -0700
From: "Edward Villalovoz" <edwardv@jps.net>
Subject: SQL INFORMIX DATABASE
Message-Id: <35a5b200.0@blushng.jps.net>
Can anyone tell me how to convert this csh script to perl? I would rather
not use any add-ons like dbi. Thanks.
#!/bin/csh
setenv INFORMIXSERVER n36_shm
dbaccess << eof
database pmsys@n36;
UNLOAD TO '/net/n28/u1/out/share/edv/Ebase/c04b.txt' DELIMITER '|'
SELECT EXTEND (start, YEAR to DAY), EXTEND (start, HOUR to MINUTE), subj1,
subj3, switchid,
dr_cand, dr_out, dr_in,
ra_total_value, ra_false_value, ra_vox_value, ravox_fls_value,
ir_cel_ho_req, ir_cel_ho_scomp, ir_cel_ho_sfail, ir_cel_ho_tcomp,
ir_cel_ho_tfail,
ir_sw_ho_scomp, ir_sw_ho_sfail, ir_sw_ho_tcomp, ir_sw_ho_talloc,
ir_sec_ho_req, ir_sec_ho_scomp, ir_sec_ho_sfail, ir_sec_ho_tcomp,
ir_sec_ho_tfail,
ia_sec_ho_req, ia_sec_ho_comp, ia_sec_ho_sfail, ia_sec_ho_tfail,
ir_tier_ho_comp, ir_tier_ho_fail,
em_ho_req, em_ho_comp, em_ho_fail,
ci_ho_dcomp, ci_ho_dfail, ci_ho_ucomp, ci_ho_ufail,
fast_ho_req
FROM tmmc0_4b_980708
WHERE EXTEND (start, HOUR to MINUTE) = "12:00";
eof
------------------------------
Date: Fri, 10 Jul 1998 08:14:53 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: trigger sending a Free Newsletter
Message-Id: <35a5c507.37923209@nntp.idsonline.com>
Dan Baker <dtbaker_@flash.net> Said this:
>HO BigD wrote:
>>
>> Hello,
>>
>> I need help! I am trying to set up a "subscribe to our newsletter" type of form
>> on our website. Does anyone know of a perl script that will do this? I know
>> they are available but have been unable to find one.
>>
>------------------
>This is not a perl solution, but if you don't want to mess with the
>upkeep of the database, or sending bulk mail at all, you can accomplish
>the same thing by using NetMind to do it for you. I've used it on
>several websites, and it's a super way to let readers control their own
>notification when you update a page. check out http://www.netmind.com
>
He's not asking about a page change notification. He wants to be able
to subscribe to a mailing list through a web form.
This is easy, especially if you use majordomo or listserv as your
mailing list manager (MLM). Since these MLMs allow email based
subscribes (and unsubscribes), you simply need to write a perl script
that generates a subscribe message.........
----------------------------------------------------------------------------
#!/usr/bin/perl
require "cgi-utils.pl";
$mail_manager = "majordomo\@lmnet.com";
# change to address "subscribe" messages are sent to
$| = 1;
%param = &get_query;
$email = $param{email};
## Sends "subscribe" message to mailing list manager
open (MAIL, "|/usr/sbin/sendmail -t");
print MAIL "From: nobody \n";
print MAIL "To: $mail_manager \n";
print MAIL "Subject: \n";
print MAIL "\n";
print MAIL "subscribe news $email\n-\n";
close MAIL;
# print something to the browser
print <<HTML;
Content-type: text/html
<html>
<head>
<title>You've been subscribed</title>
</head>
<body>
<h1>You've been subscribed</h1>
Thank you, you will now recieve the next mailing from our newsletter
mailing list
</body>
</html>
HTML
----------------------------------------------------------------------------
It's simple, and quick. I whipped this up in a matter of minutes.
An example of this is at http://www.lmnet.com/musicnews.htm - about
midway down on the left side you'll see a mailbox icon and a form
field. This form connects to the above script and subscribes the
person to a mailing list that sends out a list of music news headlines
every morning (another perl script, invoked by cron, generates that
message at 8:30 am).
I highly suggest that you use one of the MLMs I mentioned. Majordomo
takes a while to figure out when installing it, but once you have a
few lists configured, it's easy to just copy and paste the old list
settings (from sendmail's aliases file) to create new ones.
And for a newsletter style list, you can simply make it a moderated
list, and set a password, then you can create your newsletter in any
email client and just add "approve: password" as the first line of the
message and send it to the mailing list address, and let majordomo (or
listserv) deal with mailing it out to the "subscribers", and to handle
unsubscribes, etc. If it's moderated, only those messages with
approved: password in the first line will go out to the list. Plus,
the MLM will send a confirmation message to the subscriber, which
includes instructions on unsubscribing, so you shouldn't have to deal
with too many "TAKE ME OFF THIS LIST" messages.
Oh yeah... the above script probably won't work on NT, but then again,
if you went to the trouble to buy into a proprietary solution for your
server environment, you should continue the trend and look for a
proprietary solution for everything else - call your vendor and ask
them how much they want to charge you to set something like this up.
------------------------------
Date: Fri, 10 Jul 1998 09:33:37 +0200
From: Ulf Wendel <ulf.wendel@kiel.netsurf.de>
Subject: Trouble with ActiveState - urgent
Message-Id: <35A5C3D1.98157818@kiel.netsurf.de>
Hi!
I've lot's of trouble with the ActiveState Perl Version (NT, Build 316).
I simply can't include any CPAN modules - and my chief is getting
impatient... The latest error message was: "Can't find loadable object
in module... " It occurs when I type a simple "use Win32::ODBC;". @INC
is modified to look in the current working directory for modules.
Thanks!
Ulf Wendel
------------------------------
Date: 10 Jul 1998 10:02:09 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Turning off buffering
Message-Id: <isww9mm8vy.fsf@godzilla.kiere.ericsson.se>
"Henri Ossi" <henri.ossi@mail.htk.fi> writes:
> This does not work, IE waits and waits, it doesnt get the data straight from
> the perl programs output.
How do you know that? Maybe it's just waiting for the entire document
before showing you anything. Try another web browser, preferably telnet.
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: Thu, 9 Jul 1998 23:22:30 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: www.webresource.net
Message-Id: <6u44o6.j74.ln@localhost>
Rishi Bhattacharya (webmasters@webresource.net) wrote:
: Webresource.net is a new professional web site devoted to
posting articles that are not about Perl in a perl newsgroup?
There is a Usenet hierarchy already set up for Web stuff.
(I think the newsgroup name has a 'www' or something in it)
This here newsgroup is about Perl.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
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 3114
**************************************