in reply to Perl output on console as well as on text file

If you are on a *nix, you can use tee:
my-script.pl | tee output.txt
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ