Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

However, the module's author stating "THIS MODULE IS ALPHA LEVEL AND MANY BUGS." makes me feel not very good.

Well, feel better, no need to worry :)

Here is an level upgrade for rt://Win32-Unicode, that makes it use the shell the official safe way with Win32::ShellQuote

You use mySystemW and myExecWjust like you would systemW and execW

sub myExecW { use Win32::Unicode::Process qw//; my $pi = My_create_process( @_ ) or return 1; Win32::Unicode::Process::close_handle($pi->{thread_handle}); Win32::Unicode::Process::close_handle($pi->{process_handle}); return 0; } ## end sub myExecW sub mySystemW { use Win32::Unicode::Process qw//; my $pi = My_create_process( @_ ) or return 1; Win32::Unicode::Process::close_handle( $pi->{thread_handle} ); Win32::Unicode::Process::wait_for_input_idle( $pi->{process_handle +} ); Win32::Unicode::Process::wait_for_single_object( $pi->{process_han +dle} ); my $exit_code = Win32::Unicode::Process::get_exit_code( $pi->{process_handle} ); Win32::Unicode::Process::close_handle( $pi->{process_handle} ); return defined $exit_code ? $exit_code : 1; } ## end sub mySystemW sub My_create_process { use Win32::Unicode::Process qw//; use Win32::ShellQuote qw//; @_ or return; my $program = ""; my $cmdline = ""; if( @_ > 1 ) { ( $program ) = @_; $cmdline = Win32::ShellQuote::quote_system_string( @_ ); } else { ( $cmdline ) = @_; } die "Bad program name ( $program )" if $program =~ m/[<>"?*|]/; $program = Win32::Unicode::Process::utf8_to_utf16( $program ) . Win32::Unicode::Process::NULL(); $cmdline = Win32::Unicode::Process::utf8_to_utf16( $cmdline ) . Win32::Unicode::Process::NULL(); return Win32::Unicode::Process::create_process( $program, $cmdline + ); } ## end sub My_create_process

In reply to Re^3: Non asci character and system call by Anonymous Monk
in thread Non asci character and system call by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 23:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found