note
choroba
On MSWin, all filehandles are opened with the <c>:crlf</c> layer by default. Therefore, the $_ coming from <c><></c> doesn't contain the <c>\x0d</c> anymore. To get the Unix behaviour, do
<c>
binmode FH, ':raw';
</c>
<p>
<b>Update:</b> I wasn't able to make this work with <c>-n</c> and filename argument - somehow, you have to change the bimode of an open filehandle, but <c>-n</c> opens it and reads from it at the same time or something (anyone?). Therefore, I had to write the loop myself:
<c>
perl -wE 'use open IN => ":raw"; while (<>) { /(\R)/; say (unpack "H*", $1); }' file
</c>
<p><b>Update 2:</b> <c>-M</c> works, thanks [Anonymous Monk]:
<c>
perl -Mopen=IN,:raw -wnE '/(\R)/; say unpack "H*", $1' file
</c>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-832495">
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
</div></div>
1143108
1143108