To write a STDERR message, simply use the built-in warn function.
warn "Hey I'm a warning.";
But you should also use the Perl warnings module, as well as strict , because they include all sorts of useful compiler warnings and error checking for you.
So start all your programs with
use strict; use warnings; warn "Hey I'm a warning.";
(You do not need the warnings module to use the warn function.)
source share