Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Executing Windows commands using backtick

by 2teez (Vicar)
on Apr 22, 2013 at 20:08 UTC ( #1029971=note: print w/replies, xml ) Need Help??

in reply to Executing Windows commands using backtick

~ I have found numerous hits relating to the execution of Windows commands using the Perl `command` (back tick) but none work.

No example on what you meant by "windows commands" were given, so how do one know what you are referring to?

~ Has anyone successfully executed a Windows command issued from within PERL where the Windows parameter data contains UTF8

First of, there is nothing like PERL as Perl is not an acronym see What's the difference between "perl" and "Perl"?

Secondly, however to display UTF-8 output to command shell in Win7 the following work for me:

#!/usr/bin/perl use warnings; use strict; use utf8; my $null = `chcp 65001`; ## changes the Active Page Code to 65001 binmode STDOUT, ":encoding(UTF-8)"; print "\x{03B1}\x{03C9}\n";
Note: The reason for the use of backtick here instead of function like system is because, one doesn't want the string Active Page Code: 65001 displayed on the CLI. So, variable "$null" was not used, though the return string were saved in that variable.
Hope this help atleast.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1029971]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2018-04-23 12:24 GMT
Find Nodes?
    Voting Booth?