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

RE: The Santa Claus Golf Apocalypse

Thread Previous | Thread Next
From:
Keith C. Ivey
Date:
December 3, 2001 17:29
Subject:
RE: The Santa Claus Golf Apocalypse
Message ID:
3C0BE09E.4640.19038BA1@localhost
Andrew.Savige@ir.com <Andrew.Savige@ir.com> 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>;
   close(FF);
   s/^#!.*?perl(.*)\n/$1/; # remove shebang except parameters
   s/\n$//; # delete final newline in file
   return length;
}


-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About