in reply to Can you explain this error please?

Welcome Anonymous Monk to the wonderful world of Perl

As you are starting learning Perl it is important that you understand what happens and why (for my little experience).

1) yes it is only a warning and you learned how to workaround it. But don't do! You'll love how Perl trace his errors and how this helps you. Is important to be adviced about an undefined value put into a string, for example: what about the statement "My name is and i study Perl"?

When you get a warning fix it. Notice that Perls does not complain for undefined values when you evaluate them in a boolean expression like if ($maybe_defined) {..} but it advices you if you say print "My name is $may_defined and.."

You can easely use the || syntax or the ' ? : ' syntax (shortcut for if then else) and do something like

print "My name is ",$may_defined||"UNDEF","and.."

2) as already said you can declare that you do not want such category of warnings, but again don't do. In the future perahaps you can need the ability to, temporarly, disable some warnings, but dont' do it blindly.

3) Perl sends all warnings to the third filehandle that is yet opened for you: STDERR and normally shells can tell errors from normal output. So you can redirect all warnings and errors to /dev/null or wherever you like. If it really makes sense in your application do it.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.