You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(90) |
Dec
(25) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(183) |
Feb
(124) |
Mar
(123) |
Apr
(75) |
May
(49) |
Jun
(60) |
Jul
(58) |
Aug
(41) |
Sep
(27) |
Oct
(30) |
Nov
(13) |
Dec
(19) |
| 2003 |
Jan
(119) |
Feb
(70) |
Mar
(5) |
Apr
(16) |
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(3) |
Nov
(4) |
Dec
(7) |
| 2004 |
Jan
(9) |
Feb
|
Mar
(1) |
Apr
(7) |
May
(12) |
Jun
(4) |
Jul
(11) |
Aug
(17) |
Sep
(3) |
Oct
(15) |
Nov
(7) |
Dec
(2) |
| 2005 |
Jan
(4) |
Feb
(7) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
(3) |
Aug
(1) |
Sep
(9) |
Oct
(4) |
Nov
(1) |
Dec
|
| 2006 |
Jan
(5) |
Feb
(7) |
Mar
(19) |
Apr
(8) |
May
(6) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
| 2007 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(2) |
May
(2) |
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2008 |
Jan
|
Feb
(3) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
| 2009 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Joseph R. <amh...@ho...> - 2001-12-20 02:17:23
|
Earlier today, someone posted a node on perlmonks stating that they were using Matt Wright's Cookie.lib, and were having problems with it. COOKIE.LIB? YOU MEAN THERE ARE MORE OF HIS ABOMINATIONS??? Are there any plans to replace the scripts from his book? His book, unfortunately, is a best seller, so there is bound to be many of his scripts in use. I'm sure most of them have functionality also found in CGI.pm; however, that doesn't provide for drop in support. What is the general consesus of how to act? _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com |
|
From: sadf a. <amh...@ho...> - 2001-12-20 02:08:20
|
Hey, this is Joe, (on a spam account, I went home for the holidays and osu doesn't let me use their outgoing server, as I found out after trying to send this message 8-9 times). I wanted to discuss an idea I had - an Advanced Search. In the nms home page ( http://nms-cgi.sourceforge.net ), Dave states underfuture plans (condensed): >Future Plans >The initial plan is to create a set of scripts that mirror exactly the >functionality of Matt's scripts (minus the insecurities and bugs). Once >this >is complete, I'd like to look at extending the archive in four directions: >- Adding new scripts that are not in the original list. >- Adding enhance versions of the scripts which require slightly more >-knowledge from the person installing them - perhaps needing modules from >CPAN. My idea is to create an "Advanced Search" (a script not origininally available in MWS), which could overcome many of the shortcomings of the simple search. The Advanced Search would have the following additional features in addition to the functionality of the simple search: - Additional types of logical operations, and the ability to combine types (such as functionality found in google's search) - Ability to sort results (relevance, matches per page, title, filename, last modified, etc) - Sort in ascending or descending order - Display additional information about each result (last modified date, context of search, matches per page, etc) - Ability to be used "simply" (meaning that 99% of fields should be optional, so that the search could also be embedded in the page) - Ability to use a query from simple search. - Options in the config to block certain directories and files - Ability to only display a range of matches per page, with links to remaining matches, etc. - More? I have a preliminary written up here: http://www.amherst.k12.oh.us/cgi-bin/search/source_code.pl Note that the relevance sort requires an additional script I wrote to condense the weblog into a format that is faster to search through (its cronned for once every 24 hours). The relevance sort is FAR superior to the other sorts for most usage; however, it does require the weblog to be in a certain format so that the exterior script can parse it, which might confuse some of our less advanced users. Perhaps we could split the script into "Advanced Search" and "Really Advanced Search"? :) Anyone have any suggestions/ideas/flames? Joe Ryan - jfryan _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com |
|
From: Nick C. <ni...@cl...> - 2001-12-19 09:03:28
|
On Wed, Dec 19, 2001 at 07:32:00AM +0000, Dave Cross wrote: > > > > > * added non-XHTML (but harmless) NOBR tag > > > > Dave, is that OK ? > > Sounds fine to me - unless anyone has any serious objections. > > Could we make it at least _look_ like XHTML - <nobr /> - or is that a > complete waste of time? The filter ensures that there's a matching </nobr>, so there's no need for <nobr />. -- Nick |
|
From: Dave C. <da...@da...> - 2001-12-19 07:38:10
|
On Tue, Dec 18, 2001 at 11:36:06PM +0000, Nick Cleaton (ni...@cl...) wrote: > On Tue, Dec 18, 2001 at 02:21:13PM -0800, Nick Cleaton wrote: > > > > Modified Files: > > guestbook.pl > > Log Message: > > * minor HTML filter fixes > > * started on allowing the style attribute > > Just allowing the color style so far. > > > * added non-XHTML (but harmless) NOBR tag > > Dave, is that OK ? Sounds fine to me - unless anyone has any serious objections. Could we make it at least _look_ like XHTML - <nobr /> - or is that a complete waste of time? Dave... -- .sig missing... |
|
From: Nick C. <ni...@cl...> - 2001-12-18 22:36:29
|
On Tue, Dec 18, 2001 at 02:21:13PM -0800, Nick Cleaton wrote: > > Modified Files: > guestbook.pl > Log Message: > * minor HTML filter fixes > * started on allowing the style attribute Just allowing the color style so far. > * added non-XHTML (but harmless) NOBR tag Dave, is that OK ? I added it because it was the one harmless tag that the filter rejected when I pasted the front page of slashdot into the guestbook. We could just strip it out, or try to be clever and strip it out but s/ / /g until </nobr>. So, is munging the guestbook postings into truly valid XHTML a priority, or are we happy with anything that's secure against malicious scripting constructs ? -- Nick |
|
From: Nick C. <ni...@cl...> - 2001-12-15 00:35:48
|
On Fri, Dec 14, 2001 at 04:19:25PM -0800, Nick Cleaton wrote: > > Modified Files: > guestbook.pl > Log Message: > Added a whitelist-based HTML filter to strip out unsafe constructs > when $allow_html is 1 > This needs testing. It limits HTML constructs to safe tags with safe attributes, and untangles things like <b><i></b></i>. It doesn't do anything about improper nesting order (as in <i><table></table></i>) but I don't think it needs to in order to be secure against malicious scripting constructs. Since it's already too long and too complicated, I'm not inclined to add nesting order logic. -- Nick |
|
From: Jonathan S. <gel...@ge...> - 2001-12-04 11:45:10
|
On Mon, 3 Dec 2001, Dave Cross wrote: > Jacqui caren wrote: > > > [posted and mailed] > > > > da...@da... (Dave Cross) wrote in <3C0...@da...>: > > > > > >>http://nms-cgi.sourceforge.net/ > >> > > > > > > First let me say I am impressed by the overall code > > quality - use of strict removal of env vars etc > > and -T makes for an excellent start on security :-) > > > > > > > > Now for the bad part, the first script I looked at has > > the **same** stupid bug that the MSA code has - namely > > it uses sendmail as a delivery subsystem. > > Whilst this will probably be seen as a terminological nit, sendmail isn't being used as a delivery subsystem - it is a Mail Transfer Agent. > > The problem with this is that any ISP (worth thier salt) > > that has some of the sendmail anti-spam hacks enabled. > > if you are unlucky (I say lucky to have a good ISP) > > then this MTA will reject email that purports to originate > > from other than the uid of the process starting the sendmail > > process. Sendmails delivery sub system is a trowover from > > the need to support cron etc - it should not be seen as > > a way to deliver email from and to anyone... > > *gasp* sendmail is probably one of the most secure programs about and probably one of the most wildly used - at a guess I would say that about 75% of all the e-mail in the world is transmitted by a sendmail somewhere along its travels. The point about the 'anti-spam hacks' (well designed privacy controls shurely) as I understand it is that this only applies to the envelope address that can be set with the -f switch : any 'from' address in the headers of the message is not affected. A sendmail running on a webserver will probably not be running as a daemon on a well configured system anyhow and will only be used for mail injection so there is little need to implement any of the more stringent spam controls that one would have on a mailserver. Anyhow there are people here who know more about sendmail than I do. > > You pass in email addresses via cgi params - would it not > > be preferable to use soemthing a bit more secure? > > > > IMHO It is all well and good to try and be a drop-in > > replacement however leaving the MSA security holes > > to keep drop-inability is unacceptable. > > > > My worry with thsi is that a large value in $username > > that holds an EOT char could **possibly** execute a sequence > > of system commands given your shell wrapper under unixen > > systems. > > Whats an EOT char ? /J\ -- Jonathan Stowe | <http://www.gellyfish.com> | This space for rent | |
|
From: Dave C. <da...@da...> - 2001-12-03 20:03:01
|
Jacqui caren wrote: > [posted and mailed] > > da...@da... (Dave Cross) wrote in <3C0...@da...>: > > >>http://nms-cgi.sourceforge.net/ >> > > > First let me say I am impressed by the overall code > quality - use of strict removal of env vars etc > and -T makes for an excellent start on security :-) > > > > Now for the bad part, the first script I looked at has > the **same** stupid bug that the MSA code has - namely > it uses sendmail as a delivery subsystem. > > The problem with this is that any ISP (worth thier salt) > that has some of the sendmail anti-spam hacks enabled. > if you are unlucky (I say lucky to have a good ISP) > then this MTA will reject email that purports to originate > from other than the uid of the process starting the sendmail > process. Sendmails delivery sub system is a trowover from > the need to support cron etc - it should not be seen as > a way to deliver email from and to anyone... > > You pass in email addresses via cgi params - would it not > be preferable to use soemthing a bit more secure? > > IMHO It is all well and good to try and be a drop-in > replacement however leaving the MSA security holes > to keep drop-inability is unacceptable. > > My worry with thsi is that a large value in $username > that holds an EOT char could **possibly** execute a sequence > of system commands given your shell wrapper under unixen > systems. > > You also do not test the print to sendmail pipe > or the close sendmail pipe for sendmail errors > > Again these were known to be errors in MSA scripts. > > > I encourage you to provide an alternative but please > dont take your stuff down to his quality - or lack > thereof. If the original design is n itself a security > problem then revise it... > > Jacqui Jaqui. Thanks for your comments. I hope you don't mind that I've reposted them to the nms developers mailiing list. Perhpas you'd consider joining the mailing list to add your points of view - <http://lists.sourceforge.net/mailman/listinfo/nms-cgi-devel> I think that someone was doing some work on tightening up the aeara that you mention. Unfortunately, the releases are at least a week out of date with the current CVS files (my bad!) You might like to take a look at the CVS version and see if it's any better. There was some discussion of how to send email from the programs when this project was first discussed on the london.pm mailing list. My feeling is that it is very important not to rely on using CPAN modules as this could well have the effect of scaring our target audience and driving them back to the comfort of MSA. Our scripts have to be jsut as easy to use as the MSA equivalents. Given that restriction, we can either use sendmail or talk raw SMTP. We decided that sendmail was the best way to go. If you have a better suggstion, we'd welcome your input on the developers mailing list. In fact, that goes for everyone. The only way that the nms programs can be as good as I want them to be, is if we get as many opinions as possible. Please help us to achieve that. Thanks, Dave... |
|
From: Jonathan S. <gel...@ge...> - 2001-12-02 10:32:47
|
On Sat, 1 Dec 2001, Joseph F. Ryan wrote: > I updated the countdown.pl script as per previous suggestions, and it can > be found at: http://jryan.perlmonk.org/nms/countdown.txt > > Also, if someone can upload the countdown.pl > (http://jryan.perlmonk.org/nms/countdown.txt) and search.pl > (http://jryan.perlmonk.org/nms/search.txt) on the CVS, I would be most > greatful, as I am still unable to make the damn thing work. :) > > I've stuck it in the CVS. Maybe if you can get on IRC sometime we can talk you through getting the CVS to work for you. That'll be '#london.pm' on london.rhizomatic.net .... /J\ -- Jonathan Stowe | <http://www.gellyfish.com> | This space for rent | |
|
From: Jonathan S. <gel...@ge...> - 2001-12-02 10:30:17
|
On Sat, 1 Dec 2001, Joseph F. Ryan wrote: > I finally got around to fully updating search.pl to use File::Find. Since > I still can't get CVS to work (not even on cyg-win), I'll list the updates > here and put the code on my perlmonk site at: > http://jryan.perlmonk.org/nms/search.txt Right, I merged that in with one small change which was to make the wanted subroutine for find() a named subroutine rather than a closure. The closure is a nice idea and does reduce the number of global variables but it is a little more difficult to understand. Nice one /J\ -- Jonathan Stowe | <http://www.gellyfish.com> | This space for rent | |
|
From: Joseph F. R. <rya...@os...> - 2001-12-02 01:32:13
|
I updated the countdown.pl script as per previous suggestions, and it can be found at: http://jryan.perlmonk.org/nms/countdown.txt Also, if someone can upload the countdown.pl (http://jryan.perlmonk.org/nms/countdown.txt) and search.pl (http://jryan.perlmonk.org/nms/search.txt) on the CVS, I would be most greatful, as I am still unable to make the damn thing work. :) |
|
From: Joseph F. R. <rya...@os...> - 2001-12-02 01:07:56
|
I finally got around to fully updating search.pl to use File::Find. Since I still can't get CVS to work (not even on cyg-win), I'll list the updates here and put the code on my perlmonk site at: http://jryan.perlmonk.org/nms/search.txt # Revision 2.0 2001/12/01 7:30:30 jfryan # * Redid Search Algorithm using File::Find; backwards compatibility is ensured # * Added \Q\E to safely include search terms in regexp # * Removed archaic %FORM hash, and also added search defaults and error handling # * Split return_html into 3 separate functions. Also made them work, unlike return_html, which did not ;) # * Added a @blocked array to the config, defaulted it to empty. @blocked will filter out any files within a directory listed in @blocked # * Changed $style so that it can be set to '' to not use a style sheet. Also, I changed the default information to point to NMS, and not Matt's site at worldwidemart. I thought that would make sense since the whole point of the project was to dissuade people from using Matt's scripts. |
|
From: Joseph F. R. <rya...@os...> - 2001-12-02 00:59:53
|
> > One other point: '%c' as a strftime date specifier is a > > little cryptic. I would tend to prefer '%H:%M:%S %d/%m/%Y'. > > Regardless of the broken way Americans deal with dates, > > this is a little more self-documenting and therefore > > would probably let people modify the format string > > without having to read the man page. > > > >In more recent versions of the code I am documenting the replacement >parameters - I guess that I hadn't got round to the countdown script yet >:) I had been working on countdown.pl before "Crunch time" (Finals week and the week before), and although this wasn't one of the issues I had fixed (hadn't thought of it! :P). I'll fix it later tonight, when I need a break from studying. Thanks for pointing it out. |
|
From: Jonathan S. <gel...@ge...> - 2001-12-01 23:50:37
|
On Sat, 1 Dec 2001, grinder wrote:
> It's a bit late and I can't figure out what the problem is. I just
> unapacked guestbook.tar.gz (I followed the link on the webpagem
> dunno if this is the latest)... and saw
>
> % perl -Tc guestbook.cgi
> "seek" is not defined in %Fcntl::EXPORT_TAGS at /usr/libdata/perl/5.00503/Exporter.pm line 67
> Exporter::export('Fcntl', 'main', ':DEFAULT', ':flock', ':seek') called at /usr/libdata/perl/5.00503/Exporter.pm line 182
> Exporter::import('Fcntl', ':DEFAULT', ':flock', ':seek') called at guestbook.cgi line 53
> main::BEGIN() called at /usr/libdata/perl/5.00503/mach/Fcntl.pm line 53
> eval {...} called at /usr/libdata/perl/5.00503/mach/Fcntl.pm line 53
Yeah, before 5.005.<mumble> the SEEK_* defines were not included in Fcntl
- which is a little unfortunate, you think I should have known that :(.
I've been testing all the suckers with perl 5.004.04 today and all of that
should be fixed now If you get the latest version from the CVS - hey and
no warnings or anything ;-}
I might add that it took a little hacking to get perl 5.004.04 to build on
this machine - I was going to send a bug report to p5p but thought better
of it ;-}
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
|
|
From: grinder <gr...@pe...> - 2001-12-01 22:07:55
|
It's a bit late and I can't figure out what the problem is. I just
unapacked guestbook.tar.gz (I followed the link on the webpagem
dunno if this is the latest)... and saw
% perl -Tc guestbook.cgi
"seek" is not defined in %Fcntl::EXPORT_TAGS at /usr/libdata/perl/5.00503/Exporter.pm line 67
Exporter::export('Fcntl', 'main', ':DEFAULT', ':flock', ':seek') called at /usr/libdata/perl/5.00503/Exporter.pm line 182
Exporter::import('Fcntl', ':DEFAULT', ':flock', ':seek') called at guestbook.cgi line 53
main::BEGIN() called at /usr/libdata/perl/5.00503/mach/Fcntl.pm line 53
eval {...} called at /usr/libdata/perl/5.00503/mach/Fcntl.pm line 53
for reference: perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
Platform:
osname=freebsd, osvers=4.0-current, archname=i386-freebsd
uname='FreeBSD freefall.FreeBSD.org 4.0-current FreeBSD 4.0-current #0: $Date$'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='undef', gccversion=2.95.2 19991024 (release)
cppflags=''
ccflags =''
stdchar='char', d_stdstdio=undef, usevfork=true
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags ='-Wl,-E -lperl -lm '
libpth=/usr/lib
libs=-lm -lc -lcrypt
libc=, so=so, useshrplib=true, libperl=libperl.so.3
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/lib'
cccdlflags='-DPIC -fpic', lddlflags='-Wl,-E -shared -lperl -lm '
Characteristics of this binary (from libperl):
Built under freebsd
Compiled at Nov 8 2001 23:49:03
@INC:
/usr/libdata/perl/5.00503/mach
/usr/libdata/perl/5.00503
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd
/usr/local/lib/perl5/site_perl/5.005
.
__END__
David.
|
|
From: grinder <gr...@pe...> - 2001-12-01 21:34:55
|
In message <Pin...@or...>, Jonathan Stowe writes: | On Sat, 1 Dec 2001, grinder wrote: | > | > One other point: '%c' as a strftime date specifier is a | > little cryptic. I would tend to prefer '%H:%M:%S %d/%m/%Y'. | > Regardless of the broken way Americans deal with dates, | > this is a little more self-documenting and therefore | > would probably let people modify the format string | > without having to read the man page. | > | | In more recent versions of the code I am documenting the replacement | parameters - I guess that I hadn't got round to the countdown script yet No hurry, it's a pretty useless script :) What I mean is, Matt Wright actuall wrote such a thing, and people actually use it? The mind boggles. I'll take a look at the guestbook.pl script. I can't believe it, I'm actually going to put a guestbook on my site. Oh well, it's for a good cause. Later, David |
|
From: grinder <gr...@pe...> - 2001-12-01 21:26:39
|
In message <200...@eh...>, iain truskett writes: | * grinder (gr...@pe...) [02 Dec 2001 02:18]: | | [...] | > One other point: '%c' as a strftime date specifier is a little | > cryptic. I would tend to prefer '%H:%M:%S %d/%m/%Y'. Regardless of the | > broken way Americans deal with dates, this is a little more | > self-documenting and therefore would probably let people modify the | > format string without having to read the man page. | | Personally, I'd use %b rather than %m - the one that puts 'Jul' in | rather than '7'. It makes things a bit more explict which is great when | one has to cope with the fact that you've got an international audience | part of which expects m/d/y and the rest expects d/m/y. Well, that's a rather anglo-centric view of teh world. There's really no out. The ideal way would be YMD, but that's still not really widespread outside computer circles. If the only issue is between English-speaking people, %d/%m/%y is pretty self-explanatory. Later, David |
|
From: Jonathan S. <gel...@ge...> - 2001-12-01 18:08:07
|
On Sat, 1 Dec 2001, grinder wrote: > > One other point: '%c' as a strftime date specifier is a > little cryptic. I would tend to prefer '%H:%M:%S %d/%m/%Y'. > Regardless of the broken way Americans deal with dates, > this is a little more self-documenting and therefore > would probably let people modify the format string > without having to read the man page. > In more recent versions of the code I am documenting the replacement parameters - I guess that I hadn't got round to the countdown script yet :) /J\ -- Jonathan Stowe | <http://www.gellyfish.com> | This space for rent | |
|
From: Jonathan S. <gel...@ge...> - 2001-12-01 18:04:59
|
On Sat, 1 Dec 2001, grinder wrote: > Hello list, > > I downloaded the countdown script, because it seemed like > a good place to start. My idea is to run all of the nms > scripts on http://grinder.perlmonk.org/ to give them a bit > of a shakeout. > > So I configured the date to be 1/1/3001, the countdown to > the next millenium. Ran the script. Date has passed. > > Huh? > > Then it struck me... the date is based on epoch seconds. > So I set the countdown to the end of the epoch. I can > just about recite it from memory, 19/1/2038 and a few > hours more. > > Date has passed. > > Turns out, something somewhere is cutting the dates off > at an arbitrary limit: 23:59:29 31/12/2037. > > One other point: '%c' as a strftime date specifier is a > little cryptic. I would tend to prefer '%H:%M:%S %d/%m/%Y'. > Regardless of the broken way Americans deal with dates, > this is a little more self-documenting and therefore > would probably let people modify the format string > without having to read the man page. > > Here's the thing though. The 2038 limit is a little feeble. Unfortunately it is a fixed limit in the implementation of most operating systems (this is not Perl's fault). The time_t variable is (in most implementations) a 32 bit variable which (if defined as starting at 01/01/1970 as it is in POSIX ) runs out sometime in April 2038. I guess we should document this but thats about it I'm afraid ... /J\ -- Jonathan Stowe | <http://www.gellyfish.com> | This space for rent | |
|
From: Jonathan S. <gel...@ge...> - 2001-12-01 17:58:21
|
Please check the latest check in of guestbook.pl for me latest thinking of the subject - unless anyone comes back soon with a reason I shouldn't I will replace the 'use CGI::Carp' piece of all the programs with the same code, also the alterations to strip_html() as suggested by Pete Sargent ... /J\ -- Jonathan Stowe | <http://www.gellyfish.com> | This space for rent | |
|
From: iain t. <ic...@eh...> - 2001-12-01 15:27:59
|
* grinder (gr...@pe...) [02 Dec 2001 02:18]: [...] > One other point: '%c' as a strftime date specifier is a little > cryptic. I would tend to prefer '%H:%M:%S %d/%m/%Y'. Regardless of the > broken way Americans deal with dates, this is a little more > self-documenting and therefore would probably let people modify the > format string without having to read the man page. Personally, I'd use %b rather than %m - the one that puts 'Jul' in rather than '7'. It makes things a bit more explict which is great when one has to cope with the fact that you've got an international audience part of which expects m/d/y and the rest expects d/m/y. Just a thought. cheers, -- iain. <http://eh.org/~koschei/> |
|
From: grinder <gr...@pe...> - 2001-12-01 15:12:31
|
In message <200...@pe...>, grinder writes: | Hello list, | | I downloaded the countdown script, because it seemed like [...much verbiage deleted...] About my script I just posted. It lost its -T switch, because you can't run it in the debugger and print out the contents of a variable. You might want to note that in the FAQ. David. |
|
From: grinder <gr...@pe...> - 2001-12-01 15:07:28
|
Hello list, I downloaded the countdown script, because it seemed like a good place to start. My idea is to run all of the nms scripts on http://grinder.perlmonk.org/ to give them a bit of a shakeout. So I configured the date to be 1/1/3001, the countdown to the next millenium. Ran the script. Date has passed. Huh? Then it struck me... the date is based on epoch seconds. So I set the countdown to the end of the epoch. I can just about recite it from memory, 19/1/2038 and a few hours more. Date has passed. Turns out, something somewhere is cutting the dates off at an arbitrary limit: 23:59:29 31/12/2037. One other point: '%c' as a strftime date specifier is a little cryptic. I would tend to prefer '%H:%M:%S %d/%m/%Y'. Regardless of the broken way Americans deal with dates, this is a little more self-documenting and therefore would probably let people modify the format string without having to read the man page. Here's the thing though. The 2038 limit is a little feeble. Does Date::Calc know how to deal with dates beyond the end of the world (as we know it)? Why not eval a require of Date::Calc, and perform an error check on the date to see whether it is in bounds or not, according to whether we can use Date::Calc or not. Also, all those reverse @arrays is a bit ugly. Something needs to be done. Anyway, I haven't really done anything to the script yet, but there are a few things that might be worth diffing. Later, David "grinder" Landgren __DATA__ #! /usr/bin/perl -w # # $Id: countdown.pl,v 1.5 2001/11/25 11:39:38 gellyfish Exp $ # # $Log: countdown.pl,v $ # Revision 1.5 2001/11/25 11:39:38 gellyfish # * add missing use vars qw($DEBUGGING) from most of the files # * sundry other compilation failures # # Revision 1.4 2001/11/13 20:35:14 gellyfish # Added the CGI::Carp workaround # # Revision 1.3 2001/11/13 09:14:41 gellyfish # Added CGI::Carp # # Revision 1.2 2001/11/11 17:55:27 davorg # Small amount of post-import tidying :) # # Revision 1.1.1.1 2001/11/11 16:48:45 davorg # Initial import # use strict; use POSIX qw(strftime); use Time::Local; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser set_message); use vars qw($DEBUGGING); # Configuration # # $DEBUGGING must be set in a BEGIN block in order to have it be set before # the program is fully compiled. # This should almost certainly be set to 0 when the program is 'live' # BEGIN { $DEBUGGING = 0; } # @from_date = (yyyy,mm,dd,hh,mm,ss); # Which means: (year,month,day,hour,minute,second) my @from_date = (2037,12,31,23,59,59); my $date_fmt = '%d/%m/%Y %H:%M:%S'; # see 'man strftime' for more examples # $style is the URL of a CSS stylesheet which will be used for script # generated messages. This probably want's to be the same as the one # that you use for all the other pages. This should be a local absolute # URI fragment. my $style = '/grinder.css'; # End configuration BEGIN { my $error_message = sub { my ($message ) = @_; print "<h1>It's all gone horribly wrong</h1>"; print $message if $DEBUGGING; }; set_message($error_message); } $from_date[0] -= 1900; $from_date[1]--; my @diffs = ('X', 12, 'X', 24, 60, 60); if (my $query = query_string()) { $query =~ s/%2C/,/g; $query =~ s/=//g; @from_date = split(/,/, $query); } my @now = reverse((localtime)[0 .. 5]); my $from_date = strftime($date_fmt, reverse @from_date); my $now = strftime($date_fmt, reverse @now); print header(), start_html(-title => "Countdown to: $from_date", -style => {href => $style}); print h1("Countdown to: $from_date"), hr(); my $epoch_now = timelocal(reverse @now); my $epoch_future = timelocal(reverse @from_date); if ($epoch_now > $epoch_future) { print h2('Date has passed'), p("Current = $epoch_now, Target = $epoch_future."), end_html(); exit; } my @days = (31, is_leap($now[0]+1900) ? 29 : 28 , 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); my @diff = ('-') x 6; my @skip = () x 6; foreach (reverse 0 .. $#from_date) { # print "$_: [@from_date][@now][@diff]\n"; if ($from_date[$_] eq 'XX') { $skip[$_] = 1; next; } $diff[$_] = $from_date[$_] - $now[$_]; if ($diff[$_] < 0) { if ($_ == 0) { die "Argh!! Time travel not implemented"; } elsif ($_ == 2) { $diff[$_] += $days[$now[1]]; $now[$_ - 1]++; } else { $diff[$_] += $diffs[$_]; $now[$_ - 1]++; } } } #print " : [@from_date][@now][@diff]\n"; my @units = qw(Year Month Day Hour Minute Second); my $diff; for (0 .. $#diff) { next if $skip[$_]; $diff .= "$diff[$_] $units[$_]"; $diff .= 's' if $diff[$_] != 1; $diff .= "<br>\n"; } print p($diff); print hr(), p("It is currently $now"), end_html(); sub is_leap { my $y = shift; (!($y % 100) && !($y % 400)) || (($y % 100) && !($y % 4)); } __END__ |
|
From: Jonathan S. <gel...@ge...> - 2001-11-28 10:49:18
|
On Tue, 27 Nov 2001, Nick Cleaton wrote:
> On Mon, Nov 26, 2001 at 09:04:08PM +0000, Jonathan Stowe wrote:
> > >
> > > metacharacters interpreted: (?:$foo) or ($foo)
> > >
> >
> > Was the first available in 5.00404 ? If so that should be the one of
> > choice :)
>
> [downloads it]
>
> [builds it]
>
> [tries it]
>
> Yes.
>
> However, CGI::Carp::set_message isn't, at least with a default install:
>
> >> "set_message" is not exported by the CGI::Carp module at /usr/local/apache/cgi-bin/nms/FormMail.pl line 61
> >> [Tue Nov 27 14:51:26 2001] FormMail.pl: Can't continue after import errors at /usr/local/apache/cgi-bin/nms/FormMail.pl line 61
> >> [Tue Nov 27 14:51:26 2001] FormMail.pl: BEGIN failed--compilation aborted at /usr/local/apache/cgi-bin/nms/FormMail.pl line 61.
>
Bah! Either the Changes files lie or I failed to interpret them correctly
- There is a work around for this I'm sure :)
> There are also a load of warnings along the lines of
>
> >> Ambiguous use of {sort} resolved to {"sort"} at /usr/local/apache/cgi-bin/nms/FormMail.pl line 411.
>
> which I didn't see under 5.00503.
>
Ooof, that was a a bug ISTR - that can be fixed by hand ...
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
|
|
From: Nick C. <ni...@cl...> - 2001-11-27 14:07:38
|
On Mon, Nov 26, 2001 at 09:04:08PM +0000, Jonathan Stowe wrote:
> >
> > metacharacters interpreted: (?:$foo) or ($foo)
> >
>
> Was the first available in 5.00404 ? If so that should be the one of
> choice :)
[downloads it]
[builds it]
[tries it]
Yes.
However, CGI::Carp::set_message isn't, at least with a default install:
>> "set_message" is not exported by the CGI::Carp module at /usr/local/apache/cgi-bin/nms/FormMail.pl line 61
>> [Tue Nov 27 14:51:26 2001] FormMail.pl: Can't continue after import errors at /usr/local/apache/cgi-bin/nms/FormMail.pl line 61
>> [Tue Nov 27 14:51:26 2001] FormMail.pl: BEGIN failed--compilation aborted at /usr/local/apache/cgi-bin/nms/FormMail.pl line 61.
There are also a load of warnings along the lines of
>> Ambiguous use of {sort} resolved to {"sort"} at /usr/local/apache/cgi-bin/nms/FormMail.pl line 411.
which I didn't see under 5.00503.
--
Nick
|