Is it intended that users of a command line switch switch have to pay for one more
space?
E.g.:
#!perl
<bla>
-> 0 strokes for first line
#!perl -whatever
<bla>
-> 1 stroke for space between '#!perl' and '-' + strokes for switch for first line
>sub GolfScore {
> my $script = shift;
> local ($_, *FF);
> open(FF, $script) or die "could not open $script: $!";
> my $golf = -1; # your free last newline
> while (<FF>) {
> s/\n?$/\n/;
> $golf-- if $. == 1 && s/^#!.*?perl//;
> $golf += length;
> }
> close(FF);
> return $golf;
>}
Possible fix:
$golf-- if $. == 1 && s/^#!.*?perl *//;
BTW, did anybody get below 35 (with the original test program) for gs.pl?
Joerg