which $? $ is used to define scalar variables, so $line is a scalar variable, see here: http://www.comp.leeds.ac.uk/Perl/scalars.html
using regexp: ^ is the beginning of the line, $ is the end of the line, \s means white space, * means any number, so ^\s*$ means any number of white space chars between the beginning and end of the line, so the whole line can contain only white space chars.
^\s* would mean some white spaces at the beginning of the line... see here: http://perldoc.perl.org/perlretut.html
or there: http://perldoc.perl.org/perlre.html
why we do not need m? because the operator is =~, we do not need both. see: http://perldoc.perl.org/perlop.html#Binding-Operators