in reply to Re: Re: Support for hash comments on a line
in thread Support for hash comments on a line

You want to use =~ instead of = when doing regexp substitions on a variable. You're basically doing this:
$line = ($_ =~ s/\s*\#.*//);
Since $_ is undefined here, you get that warning.