http://www.perlmonks.org?node_id=1000699


in reply to Re: Perl Issue - File downloaded in windows has a Control M character in it??
in thread Perl Issue - File downloaded in windows has a Control M character in it??

what is hexdump? we are working on windows... when i used the command call unix2dos, i am getting the output i needed...but i cant use the unix2dos utility...all i need to do is using perl only...
  • Comment on Re^2: Perl Issue - File downloaded in windows has a Control M character in it??

Replies are listed 'Best First'.
Re^3: Perl Issue - File downloaded in windows has a Control M character in it??
by aitap (Curate) on Oct 24, 2012 at 20:05 UTC
    Hexdump is a hexadecimal representation of bytes in a file. You can obtain it by running something like this:
    open my $f,"<:raw","file.csv" || die $!; my $c; for (1..8) { for (1..16) { read $f,$c,1 || exit 0; print unpack "H2",$c; } print "\n"; }
    You can rewrite unix2dos in Perl using PerlIO :crlf output layer.
    Sorry if my advice was wrong.