develooper Front page | perl.fwp | Postings from December 2001

RE: The Santa Claus Golf Apocalypse

Thread Previous | Thread Next
Keith C. Ivey
December 3, 2001 17:29
RE: The Santa Claus Golf Apocalypse
Message ID:
3C0BE09E.4640.19038BA1@localhost <> wrote:

> In an earlier post, I asked all contestants to please format
> their programs on a single line, since that is what most
> experienced  golfers seemed to be doing. I want to comply with
> normal and accepted practice here. If anyone is unhappy with the
> single line formatting rule, please speak up.

I'm not unhappy, but it seems an unnecessary restriction.  An 
alternative would be to change GolfScore() to something like

sub GolfScore {
   my $script = shift;
   open(FF, $script) or die "error: open '$script'";
   local($/, $_);
   $_ = <FF>;
   s/^#!.*?perl(.*)\n/$1/; # remove shebang except parameters
   s/\n$//; # delete final newline in file
   return length;

Keith C. Ivey <>
Washington, DC

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About