[13503] in Perl-Users-Digest
Perl-Users Digest, Issue: 913 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 26 15:07:18 1999
Date: Sun, 26 Sep 1999 12:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <938372711-v9-i913@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 26 Sep 1999 Volume: 9 Number: 913
Today's topics:
Re: a question of buttons <ijg@connect.org.uk>
Re: a question of buttons <ijg@connect.org.uk>
awesome perl/CGI sites akashgoel@my-deja.com
Re: Calling Mac 'ToolBox' Function via MacPerl (Samuel)
Re: Calling Mac 'ToolBox' Function via MacPerl (Samuel)
Re: CGI sending email with attachment (Off topic) <ijg@connect.org.uk>
Re: CGI sending email with attachment <ijg@connect.org.uk>
Re: CGI sending email with attachment <ijg@connect.org.uk>
Re: CGI sending email with attachment (Matthew Bafford)
Re: cookbook: nonforker <gellyfish@gellyfish.com>
Re: How to create files from CGI script? <ijg@connect.org.uk>
Re: HTML to ASCII <gellyfish@gellyfish.com>
Re: injecting "my" varibales into caller's scope <pjl@be-NOSPAM-st.com>
LINE into array <eyl@uclink4.berkeley.edu>
Re: LINE into array <marcel.grunauer@lovely.net>
Mail parsing (Eric Smith)
Re: memory use of children <ijg@connect.org.uk>
Randomize array..... <hks3@usa.net>
Re: Regex & URL parsing... <gellyfish@gellyfish.com>
Re: rotating random banners 2 at a time <AgitatorsBand@yahoo.com>
Re: rotating random banners 2 at a time <dwoods@ucalgary.ca>
Re: rotating random banners 2 at a time <dwoods@ucalgary.ca>
Re: script hangs after reading certain amount of data <siberian@nospam.siberian.org>
Re: Scripting to handle incoming email. <ijg@connect.org.uk>
security question <mich@babylon.com>
Re: weekly update suggestions <flavell@mail.cern.ch>
Re: weekly update suggestions <dwoods@ucalgary.ca>
Re: weekly update suggestions <dwoods@ucalgary.ca>
Re: weekly update suggestions <rhomberg@ife.ee.ethz.ch>
Re: where to write perl??? <camerond@mail.uca.edu>
Re: You should be admired, or What does this have to do <dwoods@ucalgary.ca>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 26 Sep 1999 18:20:54 GMT
From: Ian Garlick <ijg@connect.org.uk>
Subject: Re: a question of buttons
Message-Id: <37EE6406.4407802C@connect.org.uk>
David P. Schwartz wrote:
> How is it possible (if at all) to use multiple buttons on an HTML form? It seems
> that the Perl script receives name+value pairs for all buttons on the form, but I'm
> not sure how to tell which one of the submit buttons was hit? (All the forms I've
> seen with multiple buttons on them all have javascript attached to them.)
This is off topic.
Go ask in a cgi/html related group what giving all buttons on a form the same name
but different values does.
------------------------------
Date: Sun, 26 Sep 1999 18:40:29 GMT
From: Ian Garlick <ijg@connect.org.uk>
Subject: Re: a question of buttons
Message-Id: <37EE689C.3D8F8D4@connect.org.uk>
Jonathan Stowe wrote:
> On Sat, 25 Sep 1999 23:32:06 -0700 David P. Schwartz wrote:
> > How is it possible (if at all) to use multiple buttons on an HTML form?
>
> You need to give them different names - how you might do that is nothing
> to do with Perl.
>
> [followups set]
Err... I know you set follow ups but I think that was a particularly bad
choiceof words.
Mind you, your still right it does have nothing to do with Perl.
(Err.... anyone know how to set followups from Nutscrape? $%^$%&^
windows).
------------------------------
Date: Sun, 26 Sep 1999 16:45:26 GMT
From: akashgoel@my-deja.com
Subject: awesome perl/CGI sites
Message-Id: <7slij4$qq2$1@nnrp1.deja.com>
The Links Archive@
http://www.ameri-source.com/tla/index.html
The Links Archive is a site created and maintained by me. It contains a
lot of links to various sites on the web including Perl/CGI. We have a
listing of a the best CGI/PERL websites available. Sites such as CGI
Resources are some of the best websites if you are looking for
tutorials on how to write Perl or if you want to copy-paste some cool
codes. We have links to a ton more so just give us a chance and I know
you will keep coming back. The link again is http://www.ameri-
source.com/tla/index.html Thanks for giving it a chance and please send
your comments etc.
Akash Goel
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 26 Sep 1999 13:52:23 -0400
From: sleidy_keinSpam_@_bitte_voicencet.com (Samuel)
Subject: Re: Calling Mac 'ToolBox' Function via MacPerl
Message-Id: <1dyqrkw.1lvvpvs8335dsN@dialup0808-pri.voicenet.com>
> &MacPerl'SetFileInfo("R*ch","TEXT",$file);
After my initial Post I then found out about the 'Big' and 'CFM68K'
Versions of 'MacPerl'.
I de-compressed the 'Big' Version and renamed it 'MacPerl [Big]' and
placed this Application with the original 'MacPerl' Application.
I de-compressed the 'CFM68K' Version and renamed it 'MacPerl [CFM68K]'
and placed this Application with the originial 'MacPerl' Application.
I then placed the the 'MacCFM68K' Folder in the 'lib' Folder.
Using the 'MacPerl [CFM68K]' Application then worked fine with the
'FSpGetCatInfo()' and 'FSpSetCatInfo()' Toolbox Functions.
I tried your suggested '&MacPerl'SetFileInfo("R*ch","TEXT",$file);'
Function and that also works.
Thank you.
Samuel
------------------------------
Date: Sun, 26 Sep 1999 13:52:05 -0400
From: sleidy_keinSpam_@_bitte_voicencet.com (Samuel)
Subject: Re: Calling Mac 'ToolBox' Function via MacPerl
Message-Id: <1dyqrcy.1x1aao81j78378N@dialup0808-pri.voicenet.com>
> As noted, you should check out the MacPerl mailing lists (though the
> proper link is http://www.macperl.org/, not .com). However, the problem
> can be solved with a proper installation. According to the directions in
> the book, you need to install the CFM68K version (page 41) you need to
> install the CFM68K version of MacPerl. You are already most of the way
> there, having installed the regular installer. Just run the cfm68k
> installer to get the correct binary and shared libraries.
Yes, after my initial Post I then found out about the 'Big' and 'CFM68K'
Versions of MacPerl.
I de-compressed the 'Big' Version and renamed it 'MacPerl [Big]' and
placed this Application with the original 'MacPerl' Application.
I de-compressed the 'CFM68K' Version and renamed it 'MacPerl [CFM68K]'
and placed this Application with the originial 'MacPerl' Application.
I then placed the the 'MacCFM68K' Folder in the 'lib' Folder.
Using the 'MacPerl [CFM68K]' Application then worked fine with the
'FSpGetCatInfo()' and 'FSpSetCatInfo()' Toolbox Functions.
Thank you.
Samuel
------------------------------
Date: Sun, 26 Sep 1999 16:06:57 GMT
From: Ian Garlick <ijg@connect.org.uk>
Subject: Re: CGI sending email with attachment (Off topic)
Message-Id: <37EE44A1.1C352165@connect.org.uk>
David Cassell wrote:
> That's feasible, and certainly legal according to the RFC. But
> I would recommend avoiding shoving a multipart inside another
> multipart. Many of the mail readers it has been my misfortune
> to encounter will not handle this situation correctly.
That's their problem. It's allowed (hell to decode), I take it you ain't
ever seen the new multipart/alternative with multipart/related inside it
yet then? :-)
------------------------------
Date: Sun, 26 Sep 1999 16:18:53 GMT
From: Ian Garlick <ijg@connect.org.uk>
Subject: Re: CGI sending email with attachment
Message-Id: <37EE476D.C3C6F405@connect.org.uk>
Burt Hwang wrote:
> Yes, I agree using open() without an error is bad. But it was simply a test
> and I knew it would open.
>
Always, but always test the return value of an open even when simply
testing.(Huh sorry Tom I know that's your line but it's so darn good and right
nothing else can beat it).
> As far as the RFCs, where can I read up on this. I don't mind at all
> reading up on things but I just didn't know where to look.
>
Damn good question. Unfortunately I may not be able to help too much.Someone
where I work downloaded all of them to do with mail (and others)
and I just read them (I have my own copies just in case) it's much faster.
He says he gets then by ftp from a London University (Imperial I think) but
that may well be too slow for you. (The link to Imperial College I mean)
Just go do a search for something like RFC archive in your favourite web
search tool. It will give you way too many hits, but should give a link to one
of the big states side uni's that carry the full RFC lists. Once you found one
your happy with (sites do differ greatly on this, some are more useable than
others) bookmark it. You wont be sorry you did.
> And you're right, it does look like there are extra "--" at the end of the
> mail.
PS. Don't quote jeopardy style around here, some get pissed real quickabout
that, and Holy Wars have been known to follow.)
Ian J. Garlick
ijg@csc.liv.ac.uk
It's a damn poor mind that can only think of one way to spell a word.
-- Andrew Jackson
------------------------------
Date: Sun, 26 Sep 1999 16:40:05 GMT
From: Ian Garlick <ijg@connect.org.uk>
Subject: Re: CGI sending email with attachment
Message-Id: <37EE4C65.93C5C839@connect.org.uk>
Kragen Sitaker wrote:
> >I though the preceeding blank line was necessary as well. ie like Burt did
> >"\n--whatever"
>
> Well, it needs to be a line by itself, not part of a line. So you need
> to have a newline before it (or have it be at the beginning of the
> file, which is not an option in this case).
>
> (Shouldn't we be using \r\n?)
Err.... yes, I hate those pesky \r's th're always getting in the way. If
only we had standards. :-(
[snipped, true statements critised as wrong !!!]
> Evidently my post, and the RFC I quoted, are not among "everything you
> have read". Either that, or you think the RFC is mistaken, or I have
> quoted it incorrectly.
>
> I assure you none of the above is true.
Apology accepted :-) (See next post) (If we could all remember everything inthe
RFC's life would be a lot easier, borring but easier.) This just happens to
be something I have been forced to become way more familiar with than I really
could wish for, but it pays the mortgage.
--
Ian Garlick
ijg@connect.org.uk
------------------------------
Date: Sun, 26 Sep 1999 17:11:15 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: CGI sending email with attachment
Message-Id: <slrn7usjkk.fvs.*@dragons.duesouth.net>
On Sun, 26 Sep 1999 16:18:53 GMT, Ian Garlick <ijg@connect.org.uk>
poured coffee onto a keyboard, producing the following in
comp.lang.perl.misc:
: Burt Hwang wrote:
: > As far as the RFCs, where can I read up on this. I don't mind at all
: > reading up on things but I just didn't know where to look.
:
: Damn good question. Unfortunately I may not be able to help too much.Someone
: where I work downloaded all of them to do with mail (and others)
: and I just read them (I have my own copies just in case) it's much faster.
First try:
<URL:http://search.yahoo.com/bin/search?p=search%20engines>
which leads you to:
<URL:http://search.yahoo.com/bin/search?p=RFC>
<URL:http://dir.yahoo.com/Computers_and_Internet/Standards/RFCs/>
<URL:http://www.webcrawler.com/cgi-bin/WebQuery?text=where%20can%20I%20download%20RFCs%3F>
<URL:http://www.google.com/search?q=RFC>
<URL:http://www.altavista.com/?pg=q&text=yes&kl=XX&q=%2BRFC+%2Bindex&search=Search>
--Matthew
------------------------------
Date: 26 Sep 1999 17:22:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: cookbook: nonforker
Message-Id: <7slkos$d1g$1@gellyfish.btinternet.com>
On 26 Sep 1999 00:04:52 +0200 Benjamin Schweizer wrote:
> +-->Jonathan Stowe <gellyfish@gellyfish.com>:
> | > I´ve upgraded my version from 5.005_2 to 5.005_3, but IO::Select
> | > doesn´t include "has_exception". What´s going wrong; is IO::Select not
> | > in the perl.rpm file?
> |
> | Have you tried installing Perl from the source ? We have no way of knowing
> | that the package you installed is correct - on Linux there is no need to
> | install pre-compiled binaries.
>
> No, I´ve installed the package of my distribution (SuSE) from their
> ftp-server.
>
Well dont do that - as I say there is no need on Linux to install a binary.
Download the source distribution and compile it - I once had SuSE on this
machine (now I have the upper hand) and I have felt no need to install a
single binary distribution.
Download <http://www.perl.com/CPAN/src/latest.gz> unpack with gunzip untar
it with tar and follow the instructions in the README file in the
directory thus produced.
We are not in a position to debug arbitrary binary distributions of Perl.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 26 Sep 1999 18:14:19 GMT
From: Ian Garlick <ijg@connect.org.uk>
Subject: Re: How to create files from CGI script?
Message-Id: <37EE627B.D86D3352@connect.org.uk>
David P. Schwartz wrote:
> Care to explain why not to put things under cgi-bin? People cannot read or write
> things there, only execute them. I don't understand how placing sensitive data
> files in more publically-accessible places == greater security. Esp. in a top-level
> dir with 666 perms!!! Excuse me???
Ok. Let me run a quick scenario. Your sys admin is brain-dead/under the
weather/notpaying attention and screws up that minor change to the http.conf file. You
don't notice
for X hours.
Joe user comes along. Clicks to get the output from your cgi and gets the script in all
it's glory. Joe happens to know just enough to make him dangerous, has a little read
twigs you are storing your data somewhere in the cgi-bin or sub dirs, and smiles cos
Christmas just come early.
Shit happens. Don't put data in cgi-bin and rely on it's ability not to show anything.
If
the script can read the data so can anybody else when the fan gets activated ready
for the aformentioned shite.
Of course this argument can apply to any dir on your hard drive(s), we are all at the
mercy of sysadmins. However anything in the web-tree is probably more vulnerable
than else where.
It's happened. I've seen it. Even the best have off days. You laugh, pull there leg but
report it damned fast.
> Also, everything is currently working just fine with the perms I showed earlier,
> except that I cannot CREATE new files. I can write to them just fine from within the
> script. (It's protect.pl at the top level.) Finally, I AM modifying the umask
> within the script: umask 000. Doesn't change a darn thing.
I have this problem sometimes.
I use ..... %$^%$&*%%$@ I don't have access to that code at this time. If this is
still a problem email me and I will post the special "do strange things to the umask"
code I got from this here NG.
------------------------------
Date: 26 Sep 1999 12:43:07 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: HTML to ASCII
Message-Id: <7sl4cr$cuq$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Abigail <abigail@delanet.com> wrote:
>
> Let's shoot people who don't RTFDTD.
>
Thats a *little* harsh wouldnt you say ? I would suggest flogging
it least it gives them an opportunity to recant.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Sep 1999 17:50:21 GMT
From: "Paul J. Lucas" <pjl@be-NOSPAM-st.com>
Subject: Re: injecting "my" varibales into caller's scope
Message-Id: <37ee5cdd$0$205@nntp1.ba.best.com>
In <slrn7ur3me.9b.abigail@alexandra.delanet.com> abigail@delanet.com (Abigail) writes:
>Paul J. Lucas (tchrist@mox.perl.com) wrote on MMCCXVII September MCMXCIII
>in <URL:news:37ed65bb$0$206@nntp1.ba.best.com>:
>{}
>{} OK, I'll post YOUR address. It meets your criteria: it's
>{} legal.
>I've reported that fact to abuse@best.com and abuse@verio.com.
Knock yourself out. I'm not forging posts; I'm not claiming
to be Tom: I'm still using my own name. (Who would want to
claim to be such an asshole as Tom anyway?)
- Paul
------------------------------
Date: Sun, 26 Sep 1999 10:19:18 -0700
From: Eugene Lee <eyl@uclink4.berkeley.edu>
Subject: LINE into array
Message-Id: <37EE5596.7CF855DC@uclink4.berkeley.edu>
Good Morning,
Is there a command to go from a LINE (from an input file) to an array?
Thanks,
Eugene
------------------------------
Date: Sun, 26 Sep 1999 17:25:14 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: LINE into array
Message-Id: <vWPuNx2IPbskJ8V42IuOgjfl0dw3@4ax.com>
On Sun, 26 Sep 1999 10:19:18 -0700, Eugene Lee
<eyl@uclink4.berkeley.edu> confused me with:
> Good Morning,
time-dependent greetings don't make a lot of sense on usenet because:
1) your posting might/will take some time to show up on other people's
newsfeed
2) those who read your message might be in a different time zone.
> Is there a command to go from a LINE (from an input file) to an array?
your request doesn't make a lot of sense either (at least to me).
maybe you mean reading lines into an array? in this case, try
@lines = <FH>;
or do you mean splitting the contents of a line to an array? if so,
read up on split().
perldoc -f split.
or maybe you mean something completely different...
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
------------------------------
Date: 26 Sep 1999 16:33:25 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: Mail parsing
Message-Id: <slrn7usimi.v6m.eric@plum.fruitcom.com>
Hi
I am currently using from procmail to break up incoming mail into its parts
and write the attachments out as files. Then procmail fires a perl script
that processes these files - (submits it as an outgoing faxjob).
The system works but there are shortcomings with the uudeview decoding at
times - especially with the body part. I am looking for a native perl way
to handle the mail. Now I do not require a po client like the one from
Sean Dowd which I use for other applications as the entire mail text file
(with all the mime parts and details) is handed to the script by procmail -
I just want to be able to parse that mail into its files and body etc.
Please suggest the code or the appropriate modules I should be using.
Thanx.
--
Eric Smith
eric@fruitcom.com
www.fruitcom.com
------------------------------
Date: Sun, 26 Sep 1999 18:33:00 GMT
From: Ian Garlick <ijg@connect.org.uk>
Subject: Re: memory use of children
Message-Id: <37EE66DC.18B39946@connect.org.uk>
Abigail wrote:
> Only on silly OSses. I once did 'perl -we "fork while fork"' on a
> Sparc 4, running Solaris 2.6.
I am curious. Did you do this deliberately to see what would happen :-)or horror of
horrors you made a mistake?
------------------------------
Date: Mon, 27 Sep 1999 02:11:53 +0800
From: "HKS" <hks3@usa.net>
Subject: Randomize array.....
Message-Id: <37ee628a.0@news.highway1.com.au>
hi there,
i just learning perl for couple of days, and i encountered a problem on
randomize the array elements and put the result into another array... say i
created an array "@num", which contains "1,2,3,4,5,6" and i want to
randomize these numbers and put it into another array, say "@result" which
will contain the randomized numbers(e.g "2,3,4,1,5,6").
i tried using "srand and rand" ..it works, but sometimes i had the same
number in the "@result" array.. (e.g "2,3,5,2,1,6") which i dont want. is
there any way i can make sure the result will not contain any duplicate
numbers?
thx for help.. :>
HKS
------------------------------
Date: 26 Sep 1999 17:04:11 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Regex & URL parsing...
Message-Id: <7sljmb$d1d$1@gellyfish.btinternet.com>
On Thu, 23 Sep 1999 22:18:51 GMT SHC wrote:
> I'd like to be able to take all plain URL references in a text string - say
> http://www.microsoft.com/windows/file.htm or www.ibm.com/pc/ and convert
> them to HTML hotlinks - <A HREF="(address)">(address)</A>. I can start the
> regex at http:// or www. easy, but I can't get it to stop at the right
> place.
>
I found the following somewhere on my computer - it purports to be the
work of Tom Christiansen :
#!perl
# urlify -- tchrist@perl.com
require 5.002; # well, or 5.000 if you see below
$urls = '(' . join ('|', qw{
http
telnet
gopher
file
wais
ftp
} )
. ')';
$ltrs = '\w';
$gunk = '/#~:.?+=&%@!\-';
$punc = '.:?\-';
$any = "${ltrs}${gunk}${punc}";
while (<>) {
## use this if early-ish perl5 (pre 5.002)
## s{\b(${urls}:[$any]+?)(?=[$punc]*[^$any]|\Z)}{<A HREF="$1">$1</A>}goi;
## otherwise use this -- it just has 5.002ish comments
s{
\b # start at word boundary
( # begin $1 {
$urls : # need resource and a colon
[$any] +? # followed by on or more
# of any valid character, but
# be conservative and take only
# what you need to....
) # end $1 }
(?= # look-ahead non-consumptive assertion
[$punc]* # either 0 or more puntuation
[^$any] # followed by a non-url char
| # or else
$ # then end of the string
)
}{<A HREF="$1">$1</A>}igox;
print;
}
HTH
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 26 Sep 1999 17:33:03 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: rotating random banners 2 at a time
Message-Id: <jNsH3.290$oy2.56642@news.shore.net>
Dan Woods <dwoods@ucalgary.ca> wrote:
: I've seen Perl scripts which can do rotating banners,
: however I was wondering what is the most efficient
: way to avoid showing the same banner twice
: on a web page ? The problem is I have a list of
: just 6-10 banners (not ads), and I want to display
: two at a time *uniquely*.
Depends on how often you want the banners to rotate. If they're only
required to change every 5 or 10 minutes, I would set up a cron job to run
a perl script to update the pages. The perl script could insure that it's
picked two different banners, and then insert them wherever you want in
the page (indicated by HTML comments or something). Depending on the size
of your site and the traffic you anticipate, this may be a better solution
than running a CGI or SSI every time a page is loaded.
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Sun, 26 Sep 1999 12:06:34 -0700
From: Dan Woods <dwoods@ucalgary.ca>
Subject: Re: rotating random banners 2 at a time
Message-Id: <7slnns$lqu@ds2.acs.ucalgary.ca>
Tom Christiansen wrote:
> I don't imagine you can tell us what site this is so we
> can add them to the real-time blackhole for web spamverts?
This site is not trying to show ads (tecnically yes, but for
themselves), instead they want to display services they
provide, or how-to-do type info, etc.
Thanks...Dan.
http://www.4loops.com
------------------------------
Date: Sun, 26 Sep 1999 12:19:04 -0700
From: Dan Woods <dwoods@ucalgary.ca>
Subject: Re: rotating random banners 2 at a time
Message-Id: <7slodk$m2k@ds2.acs.ucalgary.ca>
Scratchie wrote:
> Dan Woods <dwoods@ucalgary.ca> wrote:
> : I've seen Perl scripts which can do rotating banners,
> : however I was wondering what is the most efficient
> : way to avoid showing the same banner twice
> : on a web page ? The problem is I have a list of
> : just 6-10 banners (not ads), and I want to display
> : two at a time *uniquely*.
>
> Depends on how often you want the banners to rotate. If they're only
> required to change every 5 or 10 minutes, I would set up a cron job to run
> a perl script to update the pages.
As discussed in my "weekly update suggestions", the client's web hosting
provider does not allow cron jobs. Although I may try and get special
permissions to do so, however their "party line" is always "we have
worry about security issues". I will most likely take Kragen's idea
that I call the cgi as a cron job from my work account.
> Depending on the size
> of your site and the traffic you anticipate, this may be a better solution
> than running a CGI or SSI every time a page is loaded.
You make a valid point that I forgot to mention to the client. I don't think
they'll be interested in changing 50+ pages into SSI .shtml files, and they
are not using CGI to generate whole pages.
Thanks...Dan.
http://www.4loops.com
------------------------------
Date: Sun, 26 Sep 1999 11:00:08 -0700
From: John Armstrong <siberian@nospam.siberian.org>
Subject: Re: script hangs after reading certain amount of data
Message-Id: <37EE5E90.4003E703@nospam.siberian.org>
1) Tell us, does it effect memory usage? Watch your memory allocations as you run it.
2) Yor regex should work although it seems as if you are trying to split $_ on
whitespace which can be accomplished by just saying
( $field1 , $field2 , $field3 ) = split() ;
split's defaults are to use $_ and split on whitespace, it may be more efficient.
3) What is the runtime on this script? Is it maybe timing out or something? Is the
datafile being actively changed during runtime?
John-
"Jason Q." wrote:
>
>
> Does
>
> ($field1, $field2, $field3) = split(/\ /, $_);
> if ($product_name =~ /$keyword/i)
> {
> print "$_<P>";
> $count++;
> }
>
> have any effect on memory requirments? Because it seems the script
> dies after reading a certain amount of data, and only if there are any
> references to $_.
>
> Any help would be appreciated.
>
> Thanks.
>
> Jason Q.
------------------------------
Date: Sun, 26 Sep 1999 18:22:34 GMT
From: Ian Garlick <ijg@connect.org.uk>
Subject: Re: Scripting to handle incoming email.
Message-Id: <37EE646A.AA8E451F@connect.org.uk>
dhuang11@my-deja.com wrote:
> Hi All.
>
> I need to know how I can setup a mail server that handles incoming mail
> that can trigger signals to run a perl program. Here is what I need to
> do:
Go ask this in comp.mail.misc. Mention procmail and .forward.
------------------------------
Date: Sun, 26 Sep 1999 19:10:55 +0200
From: michael yanai <mich@babylon.com>
Subject: security question
Message-Id: <37EE539E.E242DB20@babylon.com>
Hi all
if my perl cgi script run ok with the -T( taint check )
does this mean that it is safe and can not be used
to hack my server?
I don't know if this is the right group,
if anybody knows of a better one please tell me.
thanks
Michael
------------------------------
Date: Sun, 26 Sep 1999 19:33:35 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: weekly update suggestions
Message-Id: <Pine.HPP.3.95a.990926192257.3550H-100000@hpplus03.cern.ch>
On Sat, 25 Sep 1999, Dan Woods wrote:
> Of course the one drawback I see is that hopefully no one else
> finds out about the CGI, and adds an entry in their cron job
> to change it every minute
The faq-O-matic (
http://www.dartmouth.edu/cgi-bin/cgiwrap/jonh/faq.pl?file=1 ) runs its
maintenance task in a somewhat similar way, but it sends along a
"secret" (a pseudorandom character string) from the cron job[1], to the
CGI URL that invokes the maintenance task, in order to validate the
invocation and defend against the Bogons.
[1] The cron job runs under the uid of the maintainer, while the
maintenance task has to run under the uid of the web server. So this
is quite a neatly portable way of achieving the required result.
------------------------------
Date: Sun, 26 Sep 1999 11:52:40 -0700
From: Dan Woods <dwoods@ucalgary.ca>
Subject: Re: weekly update suggestions
Message-Id: <7slmrn$lpo@ds2.acs.ucalgary.ca>
Jonathan Stowe wrote:
> On Sat, 25 Sep 1999 15:22:48 -0700 Dan Woods wrote:
> > "user:pass@http://www.here.com/cgi-bin/x.cgi (close enough).
>
> Shouldnt that be:
>
> http://user:pass@www.here.com/cgi-bin/x.cgi
>
> Anyhow if you use one of the LWP modules to do this then the module
> will take care of supplying the credentials for you.
You're right ;) I don't use this method often since I don't like
saving passwords in bookmarks or email. And I normally ignore
typing in "http://" in the browser.
Thanks for pointing it out.
...Dan.
------------------------------
Date: Sun, 26 Sep 1999 11:53:55 -0700
From: Dan Woods <dwoods@ucalgary.ca>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: weekly update suggestions
Message-Id: <7slmu2$lpo@ds2.acs.ucalgary.ca>
(apologies if this goes out twice -- news server slow to respond)
Tom Christiansen wrote:
> [courtesy cc of this posting mailed to cited author]
And one to you :)
> In comp.lang.perl.misc,
> Dan Woods <dwoods@ucalgary.ca> writes:
> :I have a need to rotate a web page "once a week" only,
> :like a 'special of the week'. I have no problem with
> :a perl script (or ksh) to do this if I can use cron
> :jobs. However, this user uses a host provider that
> :does not do that.
>
> Then you'll have to find one that does. This is crazy.
> What's next? How to write perl without typing? You
> can't live without tools.
Agreed, it's frustrating. I've researched many hosting providers
for a personal/business websites, and they're very restrictive.
*Many* do no allow telnet access, you have to ftp the files over.
You can imagine how tough it is to debug a Perl script this way.
And you can almost forget about compiling C, using crontab, and
especially sockets (like a game server). And of course the use
of MySQL (and such) is always an added monthly cost. For me this
is big time annoying since I've used UNIX/C for about 15 years.
Hell, I'm still one of those "I love Vi and won't change" guys.
Thanks...Dan.
http://www.4loops.com
------------------------------
Date: Sun, 26 Sep 1999 20:39:54 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: weekly update suggestions
Message-Id: <37EE687A.B5F6B31C@ife.ee.ethz.ch>
Dan Woods wrote:
> Can you think of any way to for a Perl script to
> do this weekly without cron jobs, no telnet
> access, and avoid using CGI ?
use 26 'at' jobs/year. Or have the script start 'at' when it's finished
- Alex
------------------------------
Date: Sun, 26 Sep 1999 13:40:31 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
To: "Gary M. Greenberg" <garyg@gator.net>
Subject: Re: where to write perl???
Message-Id: <37EE689F.2EAB47F6@mail.uca.edu>
[cc'd to gmg]
"Gary M. Greenberg" wrote:
>
> Cameron Dorey wrote:
>
> [Posted and mailed]
>
> > I wrote:
> > > I really like the new Perl CD Bookshelf ... And, www.bookpool.com has a
> > > great price (we got 2 CDs w/ Perl in a Nutshell for less than $80.00
> ^^^
> > > delivered!)
> >
> > This should be a great set, but this is a "great price"? List price from
> > ORA is $59.95 ($66.45 w/UPS ground shipping). ...
> > Perhaps your fingers slipped on the keys?
> Obviously, that wasn't clear; we got TWO "Perl CD Bookshelf & Perl in a
> Nutshell"
> packages for less than $80.00. They were $37.50 each plus S & H.
> In my mind that's a great deal NOT just a great CD.
My mistake (although I appreciate you saying you might have been
unclear). I don't have the CD Bookshelf and thought that you meant that
it came on 2 CD's. It's a lot of material there. (But I should guess,
when I think about it, not quite 650 MB worth, anyone care to tell me
how much?).
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Sun, 26 Sep 1999 12:45:10 -0700
From: Dan Woods <dwoods@ucalgary.ca>
To: Uri Guttman <uri@sysarch.com>
Subject: Re: You should be admired, or What does this have to do with Perl?
Message-Id: <7slpu6$6hi@ds2.acs.ucalgary.ca>
Uri Guttman wrote:
> i gonna go and tell my daddy about you!
My daddy's bigger than your daddy! ;)
> the fact that perl is more popular than any of the technologies you
> mentioned?
That depends on what you mean by popular. I would classify Perl, UNIX,
C, Java, sh/csh/ksh/awk, Vi/Emacs editors into the category of
"definitely not for beginners". Once you get good at them, you
love them for the power and flexibility they allow you to do programming.
I also follow comp.lang.java.programmer which usually has more posts
than this group, and if you follow for a week you'll see a difference
in the atmosphere of responses. You can image how many newbies go
to that group because they that's the new 'cool' thing to do because
of java applets. Most questions (even stupid ones) are answered quite
politely, or directed where to look. The only times I see flaming
are against students trying to get their homework done for them,
job agency postings, favorite IDE's (GUI) to use, or C vs Java debates.
> >> An atmosphere of exclusivity seems be bred in here, which is amazing,
> >> considering the number of posts and posters in this group.
>
> not exclusivity, but a lack of respect for those that don't do their
> homework. you don't get that sort of post in very specialized groups.
I have no problem with that, but doesn't everyone deserve a first chance.
I can't imagine someone working at help desk (and this group is a big one)
and answering questions in a "could be worded more nicely" response.
> s/click/clique/
> or if you can't spell fancy words, don't use them.
You got me there !
> but we ARE a bunch of high school geeks (with stock options and
> mortgages and wives, etc.) we just don't like the script kiddies without
> those things.
And if those kiddies learn Perl well, later they'll also have the same
things, and be the ones answering questions in the manner they are
learning from this current batch of experts... circle of life <grin>
P.S. thanks for taking the high road with your response, appreciated.
Thanks...Dan.
http://www.4loops.com
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 913
*************************************