Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
"be consistent"
 
PerlMonks  

Re: Executing Windows commands using backtick

by 2teez (Priest)
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


Comment on Re: Executing Windows commands using backtick
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1029971]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2014-04-20 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls