The way you're writing your print statement is unnecessarily verbose. There's no need to separate the newline into its own string. This is sufficient.
print "hello.\n";
This realization will probably make your coding easier in general.
In addition to using use feature "say"
or use 5.10.0
or use Modern::Perl
to get the built in say
feature, I'm going to pimp perl5i which turns on a lot of sensible missing Perl 5 features by default.