in reply to script and its output on different handles

Not tested:
open my $SCRIPT, 'aPerlScript.pl 1 2 |' or die $!; while (<$SCRIPT>) { print; log($logfile, $_); }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ