G'day, holandes777,
It looks like you've resolved this with ord.
I don't know how you intend to use 0x1c in your real code; however, I thought I'd just point out that it's special to Perl inasmuch as it's the default value for the subscript separator ($;).
$ perl -E 'say sprintf "%02x", ord $;' 1c
It was used in Perl4 (and earlier) to emulate multidimensional arrays. It's not needed for that purpose in Perl5: follow the link I provided for more on that.
As it's still part of the (Perl5) language, you should be aware of it; and avoid using it in a way such that it's interpreted as a subscript separator, which could result in a bug that's hard to track down. As an example, consider the following quick and dirty one-liner, which shows Data::Dump expanding the full key (e.g. 0\x1C0) but, when just printed, the (non-printable) 0x1c part is not displayed (e.g. 00).
$ perl -E 'use Data::Dump; my (%h, $x); for my $i (0,1) { for my $j (0 +,1) { $h{$i,$j} = $x++ } } dd \%h; say for sort keys %h' { "0\x1C0" => 0, "0\x1C1" => 1, "1\x1C0" => 2, "1\x1C1" => 3 } 00 01 10 11
— Ken
In reply to Re: concatenate a non-printable character onto an ascii string and inspect the content
by kcott
in thread concatenate a non-printable character onto an ascii string and inspect the content
by holandes777
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |