in reply to current array index

OK I know this is already solved but what is wrong with $.-- when you hit the !/^#/ and do the whole thing in one pass?
#!/usr/bin/perl # comment while(<>) { if (/^#/) { print; $.--; } else { print "$.:$_"; } }

Run that on itself.

--
$you = new YOU;
honk() if $you->love(perl)