Well, I donβt know if there are any special variables, but why not use open () for this task? You can specify the encoding on the tubes, as in the files:
open(my $cmdin, "-|:raw", "your command"); my $result = join('', <$cmdin>); close($cmdin);
source share