$ ./2.create.bash with_utf8.pl
The shebang is specifying bash
Using bash 4.4.19(1)-release
1
1.pl
-rwxr-xr-x 1 bob bob 125 Dec 6 11:54 1.pl
$ file -i *.pl
...
1.pl: text/x-perl; charset=utf-8
2.excel.pl: text/x-perl; charset=us-ascii
...
5.ping4.pl: text/x-perl; charset=us-ascii
6.excel.pl: text/x-perl; charset=us-ascii
latin1.pl: text/plain; charset=iso-8859-1
without_utf8.pl: text/plain; charset=utf-8
with_utf8.pl: text/plain; charset=utf-8
$
####
$ perl -pe 's/^(?=.*utf8)/#/' 1.pl | tee 1.without_utf8.pl
#!/usr/bin/perl -w
use 5.011;
#use utf8;
use Devel::Peek;
my $string = 'Gödel';
Dump($string);
$string = 'über';
Dump($string);
$string = 'alleß';
Dump($string);
$
####
$ ./1.pl
string is G�del
SV = PV(0x556af89dcda0) at 0x556af8a06fa0
REFCNT = 1
FLAGS = (POK,IsCOW,pPOK,UTF8)
PV = 0x556af8a2d730 "G\303\266del"\0 [UTF8 "G\x{f6}del"]
CUR = 6
LEN = 10
COW_REFCNT = 1
string is �ber
SV = PV(0x556af89dcda0) at 0x556af8a06fa0
REFCNT = 1
FLAGS = (POK,IsCOW,pPOK,UTF8)
PV = 0x556af8a124e0 "\303\274ber"\0 [UTF8 "\x{fc}ber"]
CUR = 5
LEN = 10
COW_REFCNT = 1
string is alle�
SV = PV(0x556af89dcda0) at 0x556af8a06fa0
REFCNT = 1
FLAGS = (POK,IsCOW,pPOK,UTF8)
PV = 0x556af89f9eb0 "alle\303\237"\0 [UTF8 "alle\x{df}"]
CUR = 6
LEN = 10
COW_REFCNT = 1
$
####
$ ./1.without_utf8.pl
string is Gödel
SV = PV(0x5584c04dbda0) at 0x5584c0505a88
REFCNT = 1
FLAGS = (POK,IsCOW,pPOK)
PV = 0x5584c052d400 "G\303\266del"\0
CUR = 6
LEN = 10
COW_REFCNT = 1
string is über
SV = PV(0x5584c04dbda0) at 0x5584c0505a88
REFCNT = 1
FLAGS = (POK,IsCOW,pPOK)
PV = 0x5584c0515040 "\303\274ber"\0
CUR = 5
LEN = 10
COW_REFCNT = 1
string is alleß
SV = PV(0x5584c04dbda0) at 0x5584c0505a88
REFCNT = 1
FLAGS = (POK,IsCOW,pPOK)
PV = 0x5584c050d0d0 "alle\303\237"\0
CUR = 6
LEN = 10
COW_REFCNT = 1
$
####
$ iconv -f UTF-8 -t us-ascii 1.pl -o 1.us-ascii.pl
iconv: illegal input sequence at position 72
$