Phoenix.pm: script archive

Pablo Velasquez pablo at dosomething.org
Tue Oct 19 13:07:45 CDT 1999


Hi,
David I was reading the Perl Cookbook and they have some flocking stuff :)
Is there some snippet you would recommend...on a Linux platform (or is that
bleh also)?

-Pablo

At 08:58 AM 10/19/99 -0700, you wrote:
>
>
>\_ OK, Call me clueless and uninformed, but could you please explain WHY
>\_ these are bad and evil?  I've been using Perl for about a month now, and
>\_ they taugh me quite a few tricks.  Some examples of better ways of writing
>\_ these scripts would, in theory, help me even more!  :-)
>
>Well, speaking from experience at a previous employer, the wwwboard
>script has a number of failings, some of the classic cs 101 "don't do
>this" stuff. 
>
>race conditions, manageability, security, etc.
>
>race conditions are particularly bad in wwwboard as there is one
>central index file that has *no* file locking on it...it can be
>updated by the webserver at any time.  That's cool until two (or more)
>people try to update it simultaneously....*poof* corrupted index, lost
>articles, global warming, the Four Horsemen.... Oh, wait, skip those
>last two.
>
>I've seen race conditions in too much of the perl code I have been
>assigned to, and it's reasonably easy to avoid with judicious use of
>flock (when it works in your OS...[aix bleh]).  
>
>Manageability is completely different.  Do you need to reproduce the
>script entirely to have another board, or can you point it at a config
>file and have it be happy?  Can administrators effectively
>administrate in the fashion they need to?  Consider not only the end
>users (surfers) but the people who have to make the thing be
>reasonable.
>
>Security is always important.  Turn on -T and -w.  Think about what
>your code could do given worst-case-input.
>
>David
>




More information about the Phoenix-pm mailing list