I would like to decode @ARGVif (and only if) the script was not running with the command line option -CA. For instance:
@ARGV
-CA
use strict; use warnings; use Encode qw(decode_utf8); BEGIN { if ( ... ) { # <--- What condition to put here? @ARGV = map { Encode::decode_utf8( $_ ) } @ARGV; } }
I found the variable ${^UNICODE}in perlvarand perlrun, but it seems that it has not documented which bit matches the value A.
${^UNICODE}
perlvar
perlrun
A
perlrunsays that Apart of the flag -Cmatches 32(my selection).
-C
32
5.8.1 -C , . , - ; .[...] A 32 the @ARGV elements are expected to be strings encoded in UTF-8
5.8.1 -C , . , - ; .
[...] A 32 the @ARGV elements are expected to be strings encoded in UTF-8
, ${^UNICODE} , -C. , , -CA , !( ${^UNICODE} & 0x20 ).
!( ${^UNICODE} & 0x20 )
Source: https://habr.com/ru/post/1672232/More articles:Strange overload behavior using variable arguments with primitive types in java - javaRedirection does not display component - reactjsWebpack compiler instance promotion? - javascriptHow to make RecyclerView recycle inside NestedScrollView? - optimizationAngular 2 forced keyboard selective verification - validationHow to iterate an object into an array of an object - javascriptJAVA: Including an alternative (||) in a loop? - javaTIMEOUT when searching data from SQL Server while executing update commands - c #Set the binding in std :: thread before executing - c ++GeoMesa Export Request Error - accumuloAll Articles