[8647] in Perl-Users-Digest
Perl-Users Digest, Issue: 2264 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 7 08:07:36 1998
Date: Tue, 7 Apr 98 05:00:41 -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 Tue, 7 Apr 1998 Volume: 8 Number: 2264
Today's topics:
Re: 5.004.004 won't configure on RH5 <tony@cyberscape.net>
Anyone working on incorporating perl into Netscape sour <tim@hcirisc.cs.binghamton.edu>
Re: calling date from a server (Chris Hamilton)
Re: Do I really have to wait for a lengthy script to fi (Peter Samuelson)
Re: Do I really have to wait for a lengthy script to fi (Bart Lateur)
Epsilon editor - anyone use it with Perl? <ewan@not.hard.to.guess>
Exchange Tracking.Log Perl statistics? <carsten@sbs.de>
Re: Exchange Tracking.Log Perl statistics? <emailco@ihug.co>
Re: Exchange Tracking.Log Perl statistics? <serge.palmers@argenta.be>
Host:Port re-directer (Parabola)
Is there a formal definition of "mbox" format? (John Brock)
MKDIR problem <ben@wallroyds.demon.co.uk>
Re: ORA Perl Conference Poll <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: Pattern searching... <ewinter@pop3.stx.com>
Re: Porting HTML into CGI Perl routine with variables. (Andre L.)
Re: PROPOSAL: The Perl Dictionary (Todd Lehman)
Re: reading file permissions <sneaker@mediaone.net>
Re: reading file permissions (Jeffrey R. Drumm)
remove dir error <beljaars@fys.ruu.nl>
setUID script (Bart Lateur)
Sorting in multi-line records. lawm@hotmail.com
Trimming blank lines from end of file? <lamber45@EGR.msu.edu>
Web spider/crawler script (Peter)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 7 Apr 1998 09:37:58 +0100
From: "Tony Kenny" <tony@cyberscape.net>
Subject: Re: 5.004.004 won't configure on RH5
Message-Id: <6gcole$23v$1@svr-c-02.core.theplanet.net>
I had this exact problem myself. The fix was to add another directory to
the path for libraries.
I think the path I added was /usr/local/include or /usr/local/lib or
something.
You can have my log file if you want.
~TK
------------------------------
Date: 07 Apr 1998 07:56:58 -0400
From: Tim Gray <tim@hcirisc.cs.binghamton.edu>
Subject: Anyone working on incorporating perl into Netscape source?
Message-Id: <t0d8et26b9.fsf@hcirisc.cs.binghamton.edu>
Now that the source code for Netscape Communicator is out, I was
wondering if any industrious hacker out there is working on putting
something similar to activestate's PerlScript into the client. A lot
of the books I read on VBScript spend several chapters on how to use
the client side stuff, but of course that leaves Netscape users out in
the cold. It would be cool if I could have the flexibility of using
perl on client and server end. Something like that might even give
Netscape a small surge in browser market share. I would imagine that
soon after it was developed, somebody would probably make it
compatible with MSIE somehow.
If nothing else it would probably be something that could win you one
of those $1000 prizes at the upcoming conference.
------------------------------
Date: 7 Apr 1998 06:59:49 GMT
From: chrish@squonk.net (Chris Hamilton)
Subject: Re: calling date from a server
Message-Id: <6gcit5$lrc$1@duke.squonk.net>
: 'scuse me? How is it that you call the date from a server and place it onto
: an HTML page? Also, can you add/subtract hours from a server's date so that
: it matches the date in another country?
:
Typically, there is a standard TCP service on port 37 which reports the
current time (in seconds since the Epoch). A simple TCP client can connect
to that port, read 4 bytes and use: unpack ("N", $read_data) to extract
the value. From there, you can run it through POSIX::strftime() or any
other conversion-type time function.
An example of this can be found on page 14 of the perlipc manual page.
As for your timezone issue, one possibility is to add or subtract seconds
from the time to match the timezone target. e.g. subtract (60 * 60)
seconds to adjust down one hour. May not be the best approach, but it's a
possible one.
Chris
---
Chris Hamilton C7 F9 1E FF 4F D8 F8 87
chrish@squonk.net F8 13 5F 69 63 B5 EB A8
"You're just jealous because the 'voices' talk to me."
------------------------------
Date: 7 Apr 1998 01:03:41 -0500
From: psamuels@sampo.REMOVETHIS.creighton.edu (Peter Samuelson)
Subject: Re: Do I really have to wait for a lengthy script to finish
Message-Id: <6gcfjt$nl1$1@sampo.creighton.edu>
[<dr.schueller@forum-medizin.com>]
> I want to run cgi scripts from my browser (or having anyone else to
> do that) without having to wait for the lengthy script to finish. It
> would be nice, if the script could report something to the user and
> close the connection while still doing the rest of the job.
How does your web server know your perl process is done (I assume
you're using Perl, since you asked on c.l.p.m.)? If it waits for
program exit, fork and exit. If it waits for file descriptors to be
closed, close 'em. (Don't forget STDERR.) If both, do both. Then
the rest of your script can go on with nobody waiting on it.
Experiment.
> This task has been asked before (it was about a mailing list, where
> someone posting an article had to wait for a lot of emails to be
> sent), but the answers given there (chron jobs doing the rest) are
> not suitable for me because of lack of sufficient chron job
> possibilities (my ISP restricts me here).
I just can't see where a cron job would work better, unless you had an
efficient way to process several data simultaneously in batch.
> Every idea will be welcome, please copy your answer directly to me.
Read this group and you'll get your very own copy of this message,
courtesy of your news software.
--
Peter Samuelson
<sampo.creighton.edu ! psamuels>
------------------------------
Date: Tue, 07 Apr 1998 10:04:09 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Do I really have to wait for a lengthy script to finish
Message-Id: <352df343.4735743@news.tornado.be>
dr.schueller@forum-medizin.com wrote:
>I want to run cgi scripts from my browser (or having anyone else to do that)
>without having to wait for the lengthy script to finish. It would be nice, if
>the script could report something to the user and close the connection while
>still doing the rest of the job.
What you must do, is fool the CGI server into thinking the script has
finished.
Look at Randal Schwartz' Webtechniques, in particular Column 20: "search
in progress page". If you haven't been there before, it's very
interesting stuff to look at the rest as well.
http://www.stonehenge.com/merlyn/WebTechniques/
HTH,
Bart.
------------------------------
Date: Tue, 7 Apr 1998 08:17:57 +0200
From: "Ewan" <ewan@not.hard.to.guess>
Subject: Epsilon editor - anyone use it with Perl?
Message-Id: <6gch05$g72$1@news01.iafrica.com>
Hi,
I recently discovered the Epsilon programmer's editor (www.lugaru.com) - all
I can say is it's awesome. It is entirely configurable (source for
everything from syntax colouring to indenting, which you can change &
compile).
Only hassle is that it doesn't come with Perl aware syntax colouring /
keywords, and I'm having no luck converting existing templates to do that!
Does anyone reading this use Epsilon - and if so, what have you done?
Appreciated!
-Ewan, ZA
------------------------------
Date: Tue, 7 Apr 1998 09:27:49 +0200
From: "Carsten B. Kinder" <carsten@sbs.de>
Subject: Exchange Tracking.Log Perl statistics?
Message-Id: <6gckcj$1ik$1@news.fth.sbs.de>
Is anybody out there who wrote a perl module to get information from the
Exchange tracking.log? I am interrested in some statistics but currently I
don't know the format of the tracking.log so I don't know how to get the
right information.
Thanks for tips
Carsten@sbs.de
------------------------------
Date: Tue, 7 Apr 1998 21:06:10 +1200
From: "Alan" <emailco@ihug.co>
Subject: Re: Exchange Tracking.Log Perl statistics?
Message-Id: <6gcqah$75j$1@newsource.ihug.co.nz>
Crystals Report has an Exchange log module, works well.
PaB
---------------------------------
Add .nz to send mail to me
Carsten B. Kinder wrote in message <6gckcj$1ik$1@news.fth.sbs.de>...
>Is anybody out there who wrote a perl module to get information from the
>Exchange tracking.log? I am interrested in some statistics but currently I
>don't know the format of the tracking.log so I don't know how to get the
>right information.
>
>Thanks for tips
>Carsten@sbs.de
>
>
------------------------------
Date: Tue, 7 Apr 1998 13:19:23 +0200
From: "Argenta Spaarbank NV" <serge.palmers@argenta.be>
Subject: Re: Exchange Tracking.Log Perl statistics?
Message-Id: <352a0b5b.0@news-feed.bru.tfi.be>
I'm using crystal reports / exchange in order to make exchange admin reports
serge.palmers@argenta.be
Carsten B. Kinder wrote in message <6gckcj$1ik$1@news.fth.sbs.de>...
>Is anybody out there who wrote a perl module to get information from the
>Exchange tracking.log? I am interrested in some statistics but currently I
>don't know the format of the tracking.log so I don't know how to get the
>right information.
>
>Thanks for tips
>Carsten@sbs.de
>
>
------------------------------
Date: Tue, 07 Apr 1998 06:48:12 GMT
From: parabola@ozemail.NO.SPAM.com.au (Parabola)
Subject: Host:Port re-directer
Message-Id: <352aca6d.18997342@news>
Hi all!
I want to have a process and run it at a box X, which would listen on
the port 80, 3128, and 8080 of X and re-dir all traffic to port 80 of
box Y. For some reason, I want the process to accept and re-dir both
TCP and UDP connection as well. (I have root access to both box X and
Y.)
Would it be cleaner to write it in Perl or C? Can someone please show
me how to do it in Perl?
Thx a lot!
:Parabola
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Intelligence is merely the accumulation of experience...
..
Parabola - the famous curve.
Email: mailto:parabola@ozemail.NO.SPAM.com.au
URL: http://parabola.home.ml.org/
(Pls remove the 'NO.SPAM' in my address when replying)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------
Date: 7 Apr 1998 03:06:09 -0400
From: jbrock@panix.com (John Brock)
Subject: Is there a formal definition of "mbox" format?
Message-Id: <6gcj91$7am@panix.com>
Followups to comp.mail.misc.
I want to write a little Perl utility to sort my mailbox files and
eliminate duplicate messages. Can someone tell me where I can find a
formal definition of the Berkeley mailbox format ("mbox")? I can look
at my own mailboxes, and the format looks pretty obvious. but I'm
worried about permissible variations which I have no way of knowing
about.
I am particularly concerned with the "From " record, because that's
what I want to sort on. The format appears to be:
"From" address date
where the date is in ctime(3) format (Wdy Mon DD HH:MM:SS YYYY), rather
than RFC 822 date format. I need to know if I can count on this always
being true, and it would also be good to know if the address can
contain embedded blanks (although of course I can always parse from the
end of the line rather than the beginning). RFC 2076 mentions the
"From " header, but doesn't say anything useful about it.
One reason I would like to be careful is that maybe when I am done I
will put the utility in the public domain for others to use. I have
asked before whether anything already exists which can do what I want
and nobody came up with anything. If anybody knows about a utility
which already does what I want please let me know!
Also, are there any good Perl subroutines out there for parsing
ctime(3) or RFC 822 date formats, or the full RFC 822 e-mail address
format? I might want to sort on other headers (Date: To: From: ...).
--
John Brock
jbrock@panix.com
------------------------------
Date: Tue, 7 Apr 1998 11:05:51 +0100
From: "bjf" <ben@wallroyds.demon.co.uk>
Subject: MKDIR problem
Message-Id: <891943558.3865.0.nnrp-05.c2de5b4a@news.demon.co.uk>
Greetings :-)
I'm having a problem ... I need to create a new directory in a script ... Ie
...
mkdir($dir, 777);
This won't work ... But when I tried ...
mkdir($dir, 766);
It worked OK ... But, I need to make the permission set to 777 ... Not 766,
can anyone tell me what I'll have to do to make the permission set to 777?
(Via script, not UNIX, FTP, whatever)
Sorry about my English by the way (Not my first language)
Thanks for reading this ...
BJF
------------------------------
Date: Mon, 6 Apr 1998 22:59:05 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: ORA Perl Conference Poll
Message-Id: <6gcfbj$8j5@bgtnsc03.worldnet.att.net>
I like the idea, especially since I probably won't be able to go.
Dustin Mollo wrote in message <6gbj2f$615$1@ultra.sonic.net>...
>Greetings fellow Perl enthusiasts!
>
>Some of you may know me as the www.perl.com maintainer. Others may not.
>Either way, I've been talking with ORA about maybe doing some live
RealAudio
>broadcasts from this year's conference, and I was wondering how many here
>might be interested in something like that.
>
>MBONE broadcasts may be possible, but I haven't done anything with the
MBONE
>for about 5 years, and I would have to ramp up a lot between now and then,
>plus I think a RealAudio broadcast may reach more people.
>
>Opinions, flames etc?
>
>-Dustin
------------------------------
Date: Tue, 7 Apr 1998 06:49:16 -0400
From: "Eric Winter" <ewinter@pop3.stx.com>
Subject: Re: Pattern searching...
Message-Id: <6gd0ce$grg@post.gsfc.nasa.gov>
Maybe this will work:
...
# fix.pl
while (<>) {
s/\cA..\cE/\n/g;
print;
}
...
Use it as follows:
fix.pl < badfile > goodfile
Does that do the trick?
hth
Eric
Mark Tong wrote in message <6gc70r$cl8@larch.cc.swarthmore.edu>...
>
>Perl gurus,
>
> I know this is damn easy but I just can't seem to figure this
>out. I have a corrupted text file that (I think) can be recovered
>using some smart perl scripting. Basically all new lines \n are being
>replaced by a sequence of ctrl-A, two random characters and then ctrl-E
>- therefore lines of the whole text file are now concatenated together
>with those characters. For example,
>
>Before corruption
>-----------------
>This is a lousy cat.
>This is a dog.
>This is a big mouse.
>
>After corruption
>----------------
>This is a lousy cat.^AeB^EThis is a dog.^A2k^EThis is a big mouse.
>
>Any help appreciated. Please reply to marktng@sccs.swarthmore.edu .
>TIA!
>
> -Mark Tong
>
>*---------------------------------------------------------------------*
>* Mark Tong (marktng@sccs.swarthmore.edu) * finger for PGP Key / URL *
>* 500 College Ave., Swarthmore, PA 19081-1397 * (610).690.3967(H) *
>*---------------------------------------------------------------------*
------------------------------
Date: Tue, 07 Apr 1998 03:12:24 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Porting HTML into CGI Perl routine with variables.
Message-Id: <alecler-0704980312240001@dialup-40.hip.cam.org>
In article <6gca2v$2b7@bgtnsc02.worldnet.att.net>, "Charles R. Thompson"
<RainCloudStudios@worldnet.att.net> wrote:
Charles,
Although I am far from deserving the title of "guru", let me field your
question.
The principle is this: if you read from a text file that contains tokens
like $this and $that, how can the Perl interpreter know that those are
meant to be Perl variables rather than mere text? Of course it can't.
But if you use this statement,
s/\$this/$this/g;
occurrences of $this will be replaced by the actual value of $this.
Your job is now to come up with the proper regular expression that will
catch things like "$form_data{'setup_file'}". Not easy, at first glance.
I just wrote a script that reads in data from one file and outputs it
through a HTML template read from a second file. Personally, I find it
easier to surround my "variables" with phony HTML tags, like so:
<form METHOD="post" ACTION="<$>$this_script_url</$>">
<input type="hidden" name="setup_file" value="<$>$form_data{'setup_file'}</$>">
<input type="hidden" name="view" value="world">
<input type="hidden" name="session_file" value="<$>$session_file</$>">
<input type="hidden" name="sort_by"
value="<$>$index_of_field_to_be_sorted_by</$>">
When that file is read in the script, I use this:
s|<\$>(.*?)</\$>|$1|g;
The $1 in the right portion evaluates to the value of anything that was
found between <$> and <\$> in the left portion.
What d'you think?
Cheers,
A.L.
==========================
> sub load_search_form
> {
> ($searchtype) = @_;
>
> if (($searchtype) eq "sim")
> {
> open(<HTML_ARCHIVE>, "./html_archives/simple_search.html_archive");
> While (<HTML_ARCHIVE>)
> {
> print;
> }
> }
> }
>
> This effectively pulls in every line of an HTML file and renders it to the
> screen. However... within the source I see things like this...
>
> <form METHOD="post" ACTION="$this_script_url">
> <input type="hidden" name="setup_file" value="$form_data{'setup_file'}">
> <input type="hidden" name="view" value="world">
> <input type="hidden" name="session_file" value="$session_file">
> <input type="hidden" name="sort_by" value="$index_of_field_to_be_sorted_by">
>
> The values of the fields do not get set in this loop I have created.
>
> 1) Can someone explain why?
> I believe that it has something to do with the scope of the variables.
Nope.
> In my original setup file code the html markup was printed in the
> following manner...
>
> print qq~
> <HTML>
> etc
> \n~;
>
> 2) Does using the print command without the qq~ option somehow mess up the
> variables from being recognized?
Nope.
------------------------------
Date: Tue, 07 Apr 1998 08:02:26 GMT
From: lehman@javanet.com (Todd Lehman)
Subject: Re: PROPOSAL: The Perl Dictionary
Message-Id: <m4lW.177$eq2.656466@ptah.visi.com>
In article <35187584.F3740951@vais.net>, Ed Finch <efinch@vais.net> wrote:
> Perl is going to take over the world. Therefore, the word perl and its
> derivitives are going to become part of everyday speech, just as "dude"
> is now. I propose the Perl Dictionary in order to establish - for those
> unfortunate enough not to know about perl - the proper use of the word.
> Sample entries:
>
> perlify (perl-i'fy), verb - 1) The process of converting an existing
> program or script into perl, for the obvious reasons. 2) The process of
> improving any person, place or thing by the addition of perl.
>
> perlification (perl-i-fi-ca'tion), noun - The superior result gained
> from the act of perlifying.
>
> perilified (perl-i'fied), past tense verb - E.g., "I perlified gcc and I
> get the tightest code ever".
>
> More entries, anyone?
> Ed
Ed,
Are you accepting words which don't contain the substring "perl" but
which in one way or another are part of the Perl culture? Here are a
few words/acronyms/phrases which may be confusing to newbies at various
stages, but which are often taken for granted by seasoned Perl hackers...
alias (typeglob)
anonymous sub
autoload (here auto means self, not automatic)
autovivification (here auto means automatic, not self)
backreference
bareword
black leopard
blue camel
bytecode
carp
character class
closure
confess
CPAN
croak
double-quotish interpolation
each through (as a transitive verb)
FMTEYEWTK
flock/flocking
global destruction
glob/globbing
grep/grepping
hash composer
hash iterator
heredoc
hip owls
JAPH
LWP
magic variables
metacharacter context
MLDBM
negative lookahead
non-greedy quantifiers
non-capturing parentheses
"Only perl can parse Perl."
Perl compiler
pink camel
pink llama
pod/POD
refcount
regex/regexp
Schwartzian Transform
shebang line
scalar context
spaceship operator
stash
string anchor
tarball
tied hash
"toenail clippings in a bowl of porridge, all the aesthetics of"
TMTOWTDI
typeglob
untaint
void context
word anchor
XS
I don't see a glossary in the PerlFAQ, and the glossry in the blue camel
doesn't contain many of these. It would be nice to see an online Lexicon
of All Things Perl... :']
--Todd
------------------------------
Date: Tue, 07 Apr 1998 10:02:33 GMT
From: Sneaker's Nest <sneaker@mediaone.net>
Subject: Re: reading file permissions
Message-Id: <3529F83B.3E@mediaone.net>
Colin Kuskie wrote:
> (No offense intended, Sneaker, but this is a job for perl, not the
> shell and it was a dead give away. Instead of posting to the
> newsgroup it's 15 minute job from start to finish.)
>
None taken :-)
> Here's the whole thing:
>
> ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
> $blksize,$blocks) = stat($filename);
>
> More than everything that you want to know about the file. To
> simplify this (since you only wanted to know the permissions) you can
> do this:
>
> ($mode) = (stat($filename))[2];
I, myself, have always known about stat. Played with it in my first
Perl scripts. But the impression I got, being a newbie I suppose, was
that the original poster wanted the file permissions - literally. A
visual representation as it were.
After I posted the backticked `ls` possibility, I wondered how far the
stat command can be taken to get get owner/group/other break-downs...
Plus I knew stat prolly was platform specific and wouldn't give positive
feed back on certain systems.
> Hope this helps,
> Colin Kuskie
Yes, it helps me and those who are reading this thread :-)
Thx,
Sneex :-)
------------------------------
Date: Tue, 07 Apr 1998 11:38:04 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: reading file permissions
Message-Id: <352a0c50.498944644@news.mmc.org>
On Tue, 07 Apr 1998 10:02:33 GMT, Sneaker's Nest <sneaker@mediaone.net> wrote:
>I, myself, have always known about stat. Played with it in my first
>Perl scripts. But the impression I got, being a newbie I suppose, was
>that the original poster wanted the file permissions - literally. A
>visual representation as it were.
Um, what's so hard to understand about 644, 700, etc? Anyone that's spent more
than a couple of weeks with Unix will recognize those permission settings. You
get them quite handily from stat (well, along with the file/device type and
sticky/setuid/setgid bits . . . but they're easy enough to strip out if you
don't want 'em)
>
>After I posted the backticked `ls` possibility, I wondered how far the
>stat command can be taken to get get owner/group/other break-downs...
Yep, and if you followed through, you discovered that it's pretty much
everything `ls . . .` gets you.
>
>Plus I knew stat prolly was platform specific and wouldn't give positive
>feed back on certain systems.
The solution you posted was a bit more platform specific than stat, don't you
think? At least stat can provide _some_ useful output on NT . . . including
basic file permissions (read-only/read-write).
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: Tue, 7 Apr 1998 10:01:43 GMT
From: Haaino Beljaars <beljaars@fys.ruu.nl>
Subject: remove dir error
Message-Id: <Pine.OSF.3.95.980407115858.12236A-100000@ruunat.fys.ruu.nl>
Hi,
>From Randal Schwartz I got the following code to remove empty directories:
#!/usr/bin/perl
use File::Find qw(finddepth $name);
my $guest = getpwnam "guest";
finddepth sub {
return if $name eq "/usr/guest";
return if (stat $_)[4] != $guest;
rmdir $_; # ignore errors
}, "/";
But unfortunaly something goes wrong:
"$name" is not exported by the File::Find module at ./del line 3
Can't continue after import errors at ./del line 3
BEGIN failed--compilation aborted at ./del line 3.
Can anybody tell me how to what went wrong and how to correct it...
Greetings from Haaino Beljaars
--------------------------------------------------
E-Mail: beljaars@phys.uu.nl -
Home Page: HTTP://www.phys.uu.nl/~beljaars/ -
File not found. Should I fake it? (Y/N) -
Beware of programmers who carry screwdrivers. -
--------------------------------------------------
------------------------------
Date: Tue, 07 Apr 1998 10:09:04 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: setUID script
Message-Id: <352ff9d2.6415404@news.tornado.be>
I've read PERLSEC very closely, digested it for over a week, and found
some info in the Camel Book (and I may press "some"), but the finer
details of setUID scripts still escape me.
Let me stress that the purpose is for use in CGI, so security is very
important.
As far as I understand: you can set the setUID bit for a script, and
then it will be run under the owner of the script's UID. The two special
variables contain UID's:
$< who launched the script ("nobody")
$> who owns the script (site owner)
But what am I to do with it? I'm not even sure what the examples in the
Camel in PERLSEC are intended for. Clarification of these examples would
be very welcome.
This particular application is for updating a data file, based on user
supplied info (as I said, in CGI). I don't want this particular data
file to be publicly writable, so I think I'll have to do the actual
updating using a setUID script.
What I reconsider doing is:
* Place a normal CGI script in my cgi-bin directory
* Place a setUID script in a directory that cannot possibly be accessed
from the WWW
* Launch this setUID script from within the CGI script.
* Use a pipe to pass the data to write, through to the setUID script.
Is this a decent approach? Are there particular security risks I have
overlooked?
And what code structure would you propose for my Perl scripts?
Bart.
------------------------------
Date: Tue, 07 Apr 1998 05:28:40 -0600
From: lawm@hotmail.com
Subject: Sorting in multi-line records.
Message-Id: <6gcv4n$rg8$1@nnrp1.dejanews.com>
Hi!
I have the following problem..tried reading the faq..didn't help much.
I have a text file in the following format....
Header1
Header2
SEPARATOR (some string &l26a1H)
.......6 lines
Key ( text identifier used for sorting)
.......n lines
SEPARATOR
.......6 lines
Key
.......n lines
PATTERN get repeated a few thousand times
EOF
What I want to do is get the separator and all the text till next separator
into a large array for all separators till EOF
Then sort this large arrays by Key, Key will be the first string in the 8th
line of the array.
I don't know If I can do all this online (using map.Schwartzian Transform sp?)
or open a new file to store the arrays and then sort them. Any hints at will
be greatly appreciated.
P.S I just started learning perl and might not know some of the "easy" stuff.
Thanx
Lawrence
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 6 Apr 1998 10:06:27 -0400
From: David Lee Lambert <lamber45@EGR.msu.edu>
Subject: Trimming blank lines from end of file?
Message-Id: <Pine.GSO.3.96.980406094557.4294B-100000@area51>
I've written a short bash/perl/find/diff script to automatically generate
a patch from my personal ChangeLog and my working source tree. As a side
effect of working on it with Windows editors, (like the Borland IDE),
the files sometimes have the CR-LF convention instead of simple CR. In
addition, they tend to acquire extra blank lines, sometimes a screenful,
at the end. I've solved the first problem with
perl -p -i.~8~ -e 's/(\r\n|\n\r)/\n/' $N
but not the second. I want each file that's about to be diffed to have
one and only one blank line at the end. Does anyone have an idea of a
perl program to do it?
--
David Lee Lambert MHm 16x20 Hack Programmer and Student
Admin of lmert.dyn.ml.org http://lmert.dyn.ml.org
My web pages are at http://web.egr.msu.edu/~lamber45
E-mail: m/lamber45\100(egr|pilot)\.msu\.edu/
The world would be a nicer place if everyone knew karate, rode bicycles and
used Unix. Unfortunately, some people have promiscous unprotected sex, drive
drunk and use Win95.
------------------------------
Date: Tue, 07 Apr 1998 06:43:33 GMT
From: delphiask@sale-net.com.au (Peter)
Subject: Web spider/crawler script
Message-Id: <3529ca7c.70190361@loomi.telstra.net>
Hi all. I am trying to find a spider or crawler type script I can use
on a linux box. I would like to say be able to enter a page or the
main page of a site and have the script find every link on that site
and index them so I can then use it like a search engine. I then enter
say a url of the sites I mostly visit and it keeps track of that site
and I have a local search engine that I use to look things up on.
Is there any out there?
Please CC: to delphiask@sale-net.com.au as news is very slow.
------------------------------
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 2264
**************************************