[23721] in Perl-Users-Digest
Perl-Users Digest, Issue: 5927 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 11 14:05:52 2003
Date: Thu, 11 Dec 2003 11:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 11 Dec 2003 Volume: 10 Number: 5927
Today's topics:
Re: $socket->timeout usage <asu1@c-o-r-n-e-l-l.edu>
[ spamming turdlet ] --> ColdFusion opportunities <malev@1ccms.com>
Re: Address matching <zawrotny@jaguar.sb.fsu.edu>
Re: Can you explain LOCAL, MY and OUR with examples? <nobull@mail.com>
Re: File handeling <jwillmore@remove.adelphia.net>
improve code - combine for & join (Mike Solomon)
Re: improve code - combine for & join <nobull@mail.com>
last index of @array <mailabuse@snafu.de>
Re: last index of @array <no@email.com>
Re: last index of @array <jgibson@mail.arc.nasa.gov>
Re: last index of @array (Tad McClellan)
Re: last index of @array <mailabuse@snafu.de>
Re: Memory: measuring 5 limitations <jwillmore@remove.adelphia.net>
Re: newbie's question on the text file processing? <nobull@mail.com>
Re: Newsgroup Searching Program <seawolf@attglobal.net>
Re: PAR / Post install problem / bad signature ... <simon.andrews@bbsrc.ac.uk>
Re: PAR / Post install problem / bad signature ... <iain@smokehythe.net>
Re: perlcc <simon.andrews@bbsrc.ac.uk>
Re: perlcc <linh@chello.no>
Re: q on 'record', 'field' separators in text files <nobull@mail.com>
Re: search Forum, BBS script <test@test.com>
Re: Server-side script executed on page load or event, <henryn@zzzspacebbs.com>
Re: Server-side script executed on page load or event, <jwillmore@remove.adelphia.net>
Re: Static Content Management -- Baking Pages rather th <jerry@jerrysievers.com>
Re: Static Content Management -- Baking Pages rather th <jane.doe@acme.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Dec 2003 15:02:31 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: $socket->timeout usage
Message-Id: <Xns944E6626AC227asu1cornelledu@132.236.56.8>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in
news:br9jfr$72b$2@mamenchi.zrz.TU-Berlin.DE:
> Sébastien Cottalorda <sppNOSPAM@monaco377.com> wrote in
> comp.lang.perl.misc:
>> A. Sinan Unur wrote:
...
>> > Now, the 10 second timeout I set on $s works like I expected: If a
>> > connection does arrive in 10 seconds, accept fails
...
>> > on both Windows XP and FreeBSD 4.8. OTOH, if I connect
...
>> > before the accept call times out, the script just hangs waiting for
>> > input and never times out.
...
>> To manage timeout on socket use IO::Select package (see perldoc).
>
> Well, yes, that's a possibility.
>
> However, if I understand Sinan's question, it is why the secondary
> socket doesn't seem to time out according to the timeout parameter.
Yes, that is indeed the question. Thank you Anno.
> I don't know either. Socket timeouts have puzzled people for ages.
OK :)
>> To not use the buffered socket use the $|=1; command at the
>> beginning of your script.
Sebastien, according to perldoc IO::Socket:
As of VERSION 1.18 all IO::Socket objects have autoflush turned on by
default.
Further, the example script is not using sockets for output at all so
autoflush behavior is very likely irrelevant.
I am curious about this. I would have been less puzzled if the second
timeout were ignored in Windows and respected in FreeBSD (after all, even
alarm works in certain contexts in Windows).
Thanks.
Sinan
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: Thu, 11 Dec 2003 14:49:49 +0000
From: Malev <malev@1ccms.com>
Subject: [ spamming turdlet ] --> ColdFusion opportunities B8
Message-Id: <6v0htvkk29r74pjujml4ha8572bdnkvjr1@4ax.com>
On Thu, 11 Dec 2003 09:50:52 -0000, CColeman@google.com (Carol Coleman) wrote:
<shit deleted>
------------------------------
Date: 11 Dec 2003 15:36:36 GMT
From: Michael Zawrotny <zawrotny@jaguar.sb.fsu.edu>
Subject: Re: Address matching
Message-Id: <slrnbth3o4.6jq.zawrotny@jaguar.sb.fsu.edu>
On Thu, 11 Dec 2003 12:24:49 +0000, Iain <iain@smokehythe.net> wrote:
> Given an IP vector A.B.C.D, I want to test for a match against a lookup
> table that may contain something like 'a.b.c.d/w', or 'a.b.c.d e.f.g.h'
> (where e.f.g.h is a mask).
>
> Please can somebody give me a few pointers or refer me to the work of a
> Perl module that does it already.
CPAN has a module called NetAddr::IP that should do all of that.
Mike
--
Michael Zawrotny
Institute of Molecular Biophysics
Florida State University | email: zawrotny@sb.fsu.edu
Tallahassee, FL 32306-4380 | phone: (850) 644-0069
------------------------------
Date: 11 Dec 2003 18:11:02 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Can you explain LOCAL, MY and OUR with examples?
Message-Id: <u9wu93xm15.fsf@wcl-l.bham.ac.uk>
Uri Guttman <uri@stemsystems.com> writes:
> there is NO need for local in callbacks. callbacks can be closure or
> have code refs which have access to lexicals. local there is dumb,
> useless and misleading.
I disagree. There is no _need_ for local() but I wouldn't throw the
tool out just because it has some problems. (BTW: one problem, that
local() cannot be applied to lexical variables, is totally
artificial).
And the "clean" alternative is not without it's problems. Perl
closures require special care to avoid memory leaks. Anonymous
subroutines make stack dumps less readable.
I recently wrote a module with code like:
use AtExit;
sub awful {
my ($various,%shared,@vars);
my ($recusive1,$recursive2);
my $cleanup = AtExit->new(sub{
undef $recursive1;
undef $recursive2;
});
$recursive1 = sub {
# Do stuff with $various,%shared,@vars and make further calls to
# &$recursive1 and &$recursive2
}
$recursive2 = sub {
# Do stuff with $various,%shared,@vars and make further calls to
# &$recursive1 and &$recursive2 and call
frobnicate($recursive1);
}
$recursive1->();
}
I decided it was more maintainable as:
our ($various,%shared,@vars);
sub awful {
local ($various,%shared,@vars);
recursive1();
}
sub recursive1 {
# Do stuff with $various,%shared,@vars and make further calls to
# &recursive1 and &recursive2
}
sub recursive2 {
# Do stuff with $various,%shared,@vars and make further calls to
# &$recursive1 and &$recursive2
frobnicate(\&recursive1);
}
Now there is a potential problem here if &frobnicate manages to
callback to &recursive1 after after awful() completes or during
another nested call to of awful(). But I happen to know that's not
going to happen.
Package variable and local() are a useful tool if you know what you
are doing. If you decide not to use that tool you should do so on
rational not emmotional grounds.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 11 Dec 2003 17:01:53 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: File handeling
Message-Id: <20031211120152.69c68fdc.jwillmore@remove.adelphia.net>
On Thu, 11 Dec 2003 05:38:38 +0000
Truthless <nospam@spamcop.org> wrote:
>
> While I am familiar with programing concepts I am quite new to perl.
> I am trying to find out what methods does perl use to retrieve file
> information. For example the size of a file and search for files
> over a certain size.
>
> I am looking for something similar to the bash command:
>
> find /home/*/*-mail/ -size +10000k
>
> I use that in a bash script for compressing large mail boxes.
>
> Could someone please point me in the right direction? Perhaps
> provide me with a small example?
Since you already have what you want to find all worked out, you could
use find2perl - which is a nice little app developed from .... the
File::Find module :-)
perldoc find2perl -or- man find2perl
Read up on the File::Find module usage to interpret the results.
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Democracy is a form of government in which it is permitted to
<wonder aloud what the country could do under first-class
<management. -- Senator Soaper
------------------------------
Date: 11 Dec 2003 08:27:58 -0800
From: mike_solomon@lineone.net (Mike Solomon)
Subject: improve code - combine for & join
Message-Id: <56568be5.0312110827.7dd7727@posting.google.com>
I have written the following code that does what I require but I am
sure it could be done better
How can I improve this
my @required = (
{company => "Company is required"},
{address1 => "Address1 is required"},
{postcode => "Postcode is required"},
{phone => "Phone is required"},
);
my (@key, @value);
for (@required) {
for (keys %{$_}) { push @key, qq {'$_'};}
for (values %{$_}) { push @value, qq {'$_'};}
}
my $key = join "," , @key;
my $value = join "," , @value;
return $key , $value;
------------------------------
Date: 11 Dec 2003 16:56:07 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: improve code - combine for & join
Message-Id: <u97k13z42g.fsf@wcl-l.bham.ac.uk>
mike_solomon@lineone.net (Mike Solomon) writes:
> I have written the following code that does what I require but I am
> sure it could be done better
>
> How can I improve this
>
> my @required = (
> {company => "Company is required"},
> {address1 => "Address1 is required"},
> {postcode => "Postcode is required"},
> {phone => "Phone is required"},
> );
I shall assume that the above is just example input data and is not
part of the 'this' you are seeking to improve. Obviously an array of
single element hashes is a very weird data structure and whatever the
data you are seeking to represent there's almost certainly a better
structure. But without knowing the problem I couldn't say what the
better structure is.
> my (@key, @value);
>
> for (@required) {
> for (keys %{$_}) { push @key, qq {'$_'};}
> for (values %{$_}) { push @value, qq {'$_'};}
> }
>
> my $key = join "," , @key;
> my $value = join "," , @value;
>
> return $key , $value;
The above is more simply written:
return join("," => map { "'$_'" } map { keys %$_ } @required),
join("," => map { "'$_'" } map { values %$_ } @required);
Or if you prefer:
return join(",", map "'$_'", map keys %$_, @required),
join(",", map "'$_'", map values %$_, @required);
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 11 Dec 2003 17:53:10 +0100
From: Martin <mailabuse@snafu.de>
Subject: last index of @array
Message-Id: <3FD8A0F6.8070102@snafu.de>
Hi folks!
is there a special variable which holds the size or last index of any
@array? some like the opposite of $[ ...
cu, md
------------------------------
Date: Thu, 11 Dec 2003 17:17:55 +0000
From: Brian Wakem <no@email.com>
Subject: Re: last index of @array
Message-Id: <pan.2003.12.11.17.17.55.596148@email.com>
On Thu, 11 Dec 2003 17:53:10 +0100, Martin wrote:
> Hi folks!
>
> is there a special variable which holds the size or last index of any
> @array? some like the opposite of $[ ...
>
> cu, md
The last index of @array is in $#array
@array has $#array+1 elements
--
Brian Wakem
------------------------------
Date: Thu, 11 Dec 2003 09:45:14 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: last index of @array
Message-Id: <111220030945140423%jgibson@mail.arc.nasa.gov>
In article <3FD8A0F6.8070102@snafu.de>, Martin <mailabuse@snafu.de>
wrote:
> Hi folks!
>
> is there a special variable which holds the size or last index of any
> @array? some like the opposite of $[ ...
>
> cu, md
$#array is the last index of @array.
@array evaluated in a scalar context is the length of @array:
my $len = @array;
------------------------------
Date: Thu, 11 Dec 2003 11:09:08 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: last index of @array
Message-Id: <slrnbth95k.v3.tadmc@magna.augustmail.com>
Martin <mailabuse@snafu.de> wrote:
> is there a special variable which holds the size
Use the name of the array in a scalar context:
my $size = @array;
> or last index of any
> @array?
my $last_index = $#array;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 11 Dec 2003 19:51:34 +0100
From: Martin <mailabuse@snafu.de>
Subject: Re: last index of @array
Message-Id: <braebn$ljj$1@news.eusc.inter.net>
Merci!
------------------------------
Date: Thu, 11 Dec 2003 16:50:50 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Memory: measuring 5 limitations
Message-Id: <20031211115049.03adc9c1.jwillmore@remove.adelphia.net>
On 11 Dec 2003 02:44:38 -0800
bart@nijlen.com (Bart Van der Donck) wrote:
> James Willmore wrote:
>
> > *If* you have shell access, you *may* be able to use
> > 'time "name of script here"'.
> > This will give you information about the execution of the script.
> > Not Perl, but it will give you more information than what you're
> > getting now.
>
> Yeah I have shell access and I can execute the time command.
>
> The output of 'time "script.cgi"' is:
> script.cgi: command not found
[Sigh}
I hate trying to type in what a command should look like - because it
always seems to be mis-interpreted.
You don't need the double quotes around the command you're trying to
execute. For example:
jim@maxine:~> time ls
[lots of output from the ls command]
real 0m0.564s
user 0m0.010s
sys 0m0.000s
jim@maxine:~>
If you can execute your script *without* typing in perl at the
beginning, then you have a script that can be executed. If not, then
you have your permissions set wrong - which looks like the case here.
> However the output format looks great and I believe that it is what
> I need:
> 0.000u 0.000s 0:00.00 0.0% 0+0k 0+0io 0pf+0w
> Am I missing something?
I haven't seen output like that from 'time' before. At least, not on
a Linux system. What OS is your host using?
The "workaround" I gave was for a *INX system - I should have been
specific about that. Sorry :-(
I'm thinking you may want to contact your host to see what solutions
they may have. We're starting to get away from Perl on this issue.
Last resort - shop around for a host that has the functionality you're
looking for - and read up a little more on using Perl through CGI.
Google is an excellent place to start - because there have been *many*
questions asked about using Perl through CGI asked and answered in
this and other newsgroups.
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
You should emulate your heros, but don't carry it too far.
Especially if they are dead.
------------------------------
Date: 11 Dec 2003 18:40:13 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: newbie's question on the text file processing?
Message-Id: <u9r7zbxkoi.fsf@wcl-l.bham.ac.uk>
> Subject: newbie's question on the text file processing?
Please put the subject of your post in the Subject of your post. If
in doubt try this simple test. Imagine you could have been bothered
to have done a search before you posted. Next imagine you found a
thread with your subject line. Would you have been able to recognise
it as the same subject?
Note: the words "newbie" and "question" are red-flag words in subject
lines.
"Jim" <bacchantecn@yahoo.com.cn> writes:
[ No context - Please don't overtrim ]
> while(my $line = <FILE>) {
> $line =~ s/[\+\-\']/_/g;
> $line = lc $line;
> my @array = ($line =~ /\b\w+\b/g);
> foreach(@array) {
> $wordFreq{$_}++;
> }
> }
>
> Is this correct? But I am not sure if the code fulfill the requirement.
I don't see why you do s/[\+\-\']/_/g
It I read the requirement correctly you want to treat hyphen, plus and
apostrophe as distinct word characters not replace then with underscore.
The leading \b in /\b\w+\b/ is redundant because // always favours the
ealiest possible match..
The trailing \b in /\b\w+\b/ is redundant because + is greedy.
BTW the variable @array is redundant - you could just use the
expression directly in the argument of foreach().
while(my $line = <FILE>} {
$wordFreq{$_}++ for lc($line) =~ /[-+'\w]+/g;
}
------------------------------
Date: Thu, 11 Dec 2003 18:58:11 GMT
From: Les Hazelton <seawolf@attglobal.net>
Subject: Re: Newsgroup Searching Program
Message-Id: <pan.2003.12.11.18.58.06.103737@attglobal.net>
On Sun, 30 Nov 2003 04:09:56 +0000, Gerard Lanois wrote:
--- snip ---
>
> So far, so good.
>
> Does your news server require an account and password? If so, you'll
> want to add lines that look like this:
>
> my $account = 'myaccount';
> my $password = 'secret';
>
> $nntp->authinfo($account, $password)
> or die "ERROR: Net::NNTP->authinfo() failed.\n";
>
--- end snip ---
>
>
> -Gerard
> http://home.san.rr.com/lanois/perl/
I have been using a copy of this program from the original article. I had
gotten as far as adding the "$nntp->authinfo($account, $password)" line
and on my development workstation it worked correectly - news items
returned and printed. However, when I moved the program to the system
where I wanted it to run, it stopped working.
The problem is the development system is running stunnel and for various
reasons, I don't want to put stunnel on the target system. I need to
supply a port number on the target system to enable the secure connection.
I have searched this news group, google and CPAN looking for information
on providing a port number for the connection and no luck. Can you point
me in the right direction?
--
Les Hazelton
--- Registered Linux user # 272996 ---
Numeric stability is probably not all that important when you're guessing.
------------------------------
Date: Thu, 11 Dec 2003 14:48:51 +0000
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: PAR / Post install problem / bad signature ...
Message-Id: <bra04k$b21$1@south.jnrs.ja.net>
Iain wrote:
> Any PAR users out there?
>
> I've just built and tested PAR and most things are fine but for one
> niggling little issue that isn't addressed by PAR::FAQ.
>
> My resulting standalone binary runs okay but spews forth warnings like
> this one:
>
> format error: bad signature: 0x6174545f at offset 78727 in file
> IO::File=GLOB(0x8455f04)
> at /path/to/Module.pm line 7
This is a bug which was introduced with the latest update to
Archive::Zip (v 1.09). The zip file has a checksum cacluated, but PAR
adds some loader code to the front of it causing the checksum to be
invalid when the archive is extracted.
A fix should hopefully be present in Archive::Zip 1.10 and PAR 0.77, but
for now you can lose the warning by downgrading Archive::Zip to an older
verison.
------------------------------
Date: Thu, 11 Dec 2003 14:52:28 +0000
From: Iain <iain@smokehythe.net>
Subject: Re: PAR / Post install problem / bad signature ...
Message-Id: <3I%Bb.20010$lm1.174140@wards.force9.net>
Simon Andrews wrote:
> Iain wrote:
-->8--
> This is a bug which was introduced with the latest update to
> Archive::Zip (v 1.09). The zip file has a checksum cacluated, but PAR
> adds some loader code to the front of it causing the checksum to be
> invalid when the archive is extracted.
>
> A fix should hopefully be present in Archive::Zip 1.10 and PAR 0.77, but
> for now you can lose the warning by downgrading Archive::Zip to an older
> verison.
Thanks, Simon, I'll downgrade Archive::Zip for now.
Iain :-)
--
Blow the smoke from my address before replying direct to me.
------------------------------
Date: Thu, 11 Dec 2003 14:39:26 +0000
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: perlcc
Message-Id: <br9viu$ath$1@south.jnrs.ja.net>
ngoc wrote:
> Hi
> I use pp -o program_name program_name.pl to compile.
> But get error message:
> Missing }.
Sounds like your script doesn't compile. What is the output of
perl -c program_name.pl
This will need to be sorted before you try to do anything with pp
> I just modify #!perl to # use perl in pp because #!perl do not run.
> How to solve that problem ?
The #! line should contain the path to your perl executable. You don't
tell us anything about your setup, but assuming you're on some form of
*nix you should run
which perl
and put the output on the first line after #!
eg #!/usr/bin/perl
Your script must also have execute permissions to be run directly, so
assuming you have sorted out the first line you should then do:
chmod 755 program_name.pl
to allow you to then run it using:
./program_name.pl
------------------------------
Date: Thu, 11 Dec 2003 16:37:47 +0100
From: "ngoc" <linh@chello.no>
Subject: Re: perlcc
Message-Id: <jb0Cb.4986$n31.86589@news2.e.nsc.no>
Hi
perl -c program_name.pl give output syntax is ok.
I change
# use perl
eval 'exec perl -S $0 ${1+"$@"}'
if 0;
to #path of which perl
and pp -o program_name program_name.pl . It gives no error message.
But when I run it ./program_name. It shows "format error: bad signature:
...." before it shows the GUI.
I have to thank to Perl community. You are helpful. It is my first time in
newsgroup. I get answers quickly and learn much.
Ngoc
"Simon Andrews" <simon.andrews@bbsrc.ac.uk> wrote in message
news:br9viu$ath$1@south.jnrs.ja.net...
> ngoc wrote:
> > Hi
> > I use pp -o program_name program_name.pl to compile.
> > But get error message:
> > Missing }.
>
> Sounds like your script doesn't compile. What is the output of
>
> perl -c program_name.pl
>
> This will need to be sorted before you try to do anything with pp
>
> > I just modify #!perl to # use perl in pp because #!perl do not run.
> > How to solve that problem ?
>
> The #! line should contain the path to your perl executable. You don't
> tell us anything about your setup, but assuming you're on some form of
> *nix you should run
>
> which perl
>
> and put the output on the first line after #!
>
> eg #!/usr/bin/perl
>
> Your script must also have execute permissions to be run directly, so
> assuming you have sorted out the first line you should then do:
>
> chmod 755 program_name.pl
>
> to allow you to then run it using:
>
> ./program_name.pl
>
------------------------------
Date: 11 Dec 2003 17:19:22 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: q on 'record', 'field' separators in text files
Message-Id: <u91xrbz2zp.fsf@wcl-l.bham.ac.uk>
sparkane <nertz@numb.no> writes:
> What characters if any are typically used to delimit 'fields' and
> 'records' in a text file?
Commas, whitespace, pipes, newlines, double-newlines...
> I'm working on a rewrite of an app that stores some data in text files
> and uses '|' and "\n" as 'field' and 'record' separators, respectively.
> I want to replace these and have been thinking of using "\e" and
> "\0",
If you are going to use non-printable characters why not just use the
field-separator "\x1c" and record-separator "\x1e" characters defined
by ASCII[1]?
This, of course, has nothing to do with Perl.
[1] Or Unicode, same thing in this case - codepoints 0-0x7F of Unicode
are ASCII.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 11 Dec 2003 18:31:01 GMT
From: "Liberal" <test@test.com>
Subject: Re: search Forum, BBS script
Message-Id: <FJ2Cb.180164$Ec1.6815113@bgtnsc05-news.ops.worldnet.att.net>
link to it?
> Have you looked at Discus? Very customizable and easy to install,
> either manually or with thier autoinstall option.
>
> HTH,
> Judy
>
------------------------------
Date: Thu, 11 Dec 2003 16:57:01 GMT
From: Henry <henryn@zzzspacebbs.com>
Subject: Re: Server-side script executed on page load or event, but not SSI
Message-Id: <BBFDE1DC.18FEE%henryn@zzzspacebbs.com>
Jim:
Thanks for your post on this thread:
in article 20031210153122.43d1234b.jwillmore@remove.adelphia.net, James
Willmore at jwillmore@remove.adelphia.net wrote on 12/10/03 12:31 PM:
> On Wed, 10 Dec 2003 04:19:06 GMT
> Henry <henryn@zzzspacebbs.com> wrote:
>> However, there's a couple of housekeeping chores to do occasionally:
>> For example, looking for database updates and downloading them if
>> required.
>
> Use the DBI module.
I looked at the DBI docs and my head is swimming. I don't think I need
that.
Gee, I'm sorry I used the term 'database'. For what I wanted to ask, it
really doesn't much matter what the raw material is.
What I was trying to do is get a handle on the alternatives for running a
perl cgi script. I know I can do it simply by linking to the script, or by
a form "action". Both these require a user to do something. I'm looking
for running a perl script automagically when a page is loaded.
I believe I understand that I can enable SSI's and have a script run
automagically at load time to fill in content. In fact, the script can do
anything, and that would fulfill my need.
Are there any other perl alternatives? I guess I can run javascript or tcl
from any intrinsic event --per the html 4 standard chapter 18-- but I don't
seem to be able to do this with perl, right? I'm not up to learning yet
another language at this point -- my hands are full with perl.
>
>> Behind the scenes is a script --perl, I hope-- that runs when the
>> entry page is loaded which checks to see if it's been run already
>> that day. If not then it checks the modification date opf the remote
>> database, and ...you get the picture.
>
> Yes, but are you looking for something already made? If so, go to
> http://freshmeat.net/.
I don't think there's anything at freshmeat.net that will help -- this is
all custom stuff. I keep forgetting to check freshmeat regularly just in
case.
Thanks,
Henry
henryn@zzzspacebbs.com remove 'zzz'
>
> HTH
------------------------------
Date: Thu, 11 Dec 2003 17:28:36 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Server-side script executed on page load or event, but not SSI
Message-Id: <20031211122836.11c6c053.jwillmore@remove.adelphia.net>
On Thu, 11 Dec 2003 16:57:01 GMT
Henry <henryn@zzzspacebbs.com> wrote:
> in article 20031210153122.43d1234b.jwillmore@remove.adelphia.net,
> James Willmore at jwillmore@remove.adelphia.net wrote on 12/10/03
> 12:31 PM:
> > On Wed, 10 Dec 2003 04:19:06 GMT
> > Henry <henryn@zzzspacebbs.com> wrote:
> Gee, I'm sorry I used the term 'database'. For what I wanted to
> ask, it really doesn't much matter what the raw material is.
Well, in a way it does. If you're reading a CSV file, then the
DBD::CSV module can aid in this task. OTOH, you know what you're
doing with the information better than I do. So, I'll just move on
:-)
> Are there any other perl alternatives? I guess I can run
> javascript or tcl from any intrinsic event --per the html 4 standard
> chapter 18-- but I don't seem to be able to do this with perl,
> right? I'm not up to learning yet another language at this
> point -- my hands are full with perl.
You can use Perl for the task you're suggesting. What are you using
now to display the pages? Are they static? If so, would you be
adverse to having the pages be dynamic on the server side (meaning,
have a CGI script display the pages)? Just off the top of my head,
you could use a single script to execute a command (like finding out
if the pages are up to date), then redirect the user to the
appropriate page. No 'form' required :-) That could be one solution.
I know it can be done with Perl. You just need to re-think what you
want and how to get there (outside the box, as it where).
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Hard work may not kill you, but why take chances?
------------------------------
Date: 11 Dec 2003 10:43:16 -0500
From: Jerry Sievers <jerry@jerrysievers.com>
Subject: Re: Static Content Management -- Baking Pages rather than Frying them
Message-Id: <m3brqf4ay3.fsf@prod01.jerrysievers.com>
google@dotinf.co.uk (Ben B) writes:
> I'm looking for a tool or series of tools to help me manage the
> content of a website. My request is odd because I have no need to
> manage content on-the-fly. I would be happy to regenerate pages each
> time the content is updated.
i can't offer you a shrink wrapped app. sorry.
however, this sort of site building i've done plenty of.
with only two basic tools, make and the m4 macro processor, you can
set this up very easily.
both of these are open source tools by GNU that i believe will work on
windows.
get in touch and i'll chat you up about this and get you started.
HTH
--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
305 321-1144 (mobile http://www.JerrySievers.com/
------------------------------
Date: Thu, 11 Dec 2003 19:28:50 +0100
From: Jane Doe <jane.doe@acme.com>
Subject: Re: Static Content Management -- Baking Pages rather than Frying them
Message-Id: <aodhtvs0pifodct4gn4cpd0k7aihnvs311@4ax.com>
On 10 Dec 2003 09:54:13 -0800, google@dotinf.co.uk (Ben B) wrote:
>I'm looking for a tool or series of tools to help me manage the
>content of a website. My request is odd because I have no need to
>manage content on-the-fly. I would be happy to regenerate pages each
>time the content is updated.
Not open-source, but
Radio UserLand ($39,95)
http://radio.userland.com/
FogCreek CityDesk ($300 for the full version)
http://www.fogcreek.com/CityDesk/
JD.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 5927
***************************************