Changing the I / O Levels Used by Reverse Windows

i.e. opportunity

$result = `my command`; 

using :raw :utf8 etc.

Any special variables that I don't know about, alternative methods or modules that can be used?

+4
source share
2 answers

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); 
+9
source

Use popen:

 open (my $fd, "-|", $prog, @args) or die "Couldn't start $prog: $!"; do_whatever($fd); while (<$fd>) { ... }; 

Or, if that is not enough, you should look at IPC :: Open2 and its cousin Open3.

+2
source

All Articles