[EMAIL PROTECTED] wrote:
>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//;
I just realized I was being unfairly penalized by this line because my
hash-bang line looks like this:
#!/some/path/perl5/bin/perl
Might I suggest the following instead?
$golf-- if $. == 1 && s/^#!.*?perl(?!\S)//;
> $golf += length;
> }
> close(FF);
> return $golf;
>}
--
"It's a deicide. This guy Lokk arranged the murder of this guy Baldur.
Now Baldur's Dad's going postal and threatening to end the universe..."
"I've had enough of this. Listen, Pops, you end the universe and I'm
running you BOTH in!" -- from Top Ten #7 | Sean McAfee | [EMAIL PROTECTED]