Debug prints such as yours entail a runtime hit, which is almost always negligible; but they also clutter the code, which often isn't.
I'm not saying never put in debug prints and prefer the debugger instead--I prefer prints myself--but it's useful to distinguish prints you put in for fixing a particular problem at hand, which are usually temporary and removed after the problem is resolved, and logging messages, which are usually permanent even if easily turned off.
For the latter, there are many elaborate logging packages on CPAN, such as Log::Dispatch and Log::Log4perl to name two. For the former, where both informativeness and easy removal are important I usually use these subs which I stick in some common module:
sub ::Y { require YAML::Syck; YAML::Syck::Dump(@_) }
sub ::YY { require Carp; Carp::confess(::Y(@_)) }
(It used to be ::D and ::DD using
Data::Dumper instead of
YAML::Syck, but I often end up installing the non-core Y::S on systems I use anyway, and I like its output better.)