in reply to Re: Can't find \x0D
in thread Can't find \x0D

My apologies...this is on an AIX machine. I'm also using binmode. In fact, this is the entire program (just in case I leave any other important facts out! :) ):

#!/usr/bin/perl

use strict;

my $inFile = "TST5.NDM.SB.IOWSFLAT.STMTS.MRDF.TEST";
my $outFile = "$inFile.out";
my $buff;

open(INFP, $inFile);
open(OUTFP, ">$outFile");
binmode(INFP);
binmode(OUTFP); 

my $cnt = 1;
my $matchCnt = 0;

while (read(INFP, $buff, 128)) {

  print OUTFP $buff;
  
  my $target = "\x0D";
  if ($buff =~ /$target/) {
    print $buff;
    print "\n found \$target on 'line' $cnt, ";
    print "'" . ord($&) . "', '\x$&'\n";
    ++$matchCnt;
  }
  ++$cnt;
}

print "found target $matchCnt times\n";
close (INFP);
close (OUTFP);

Replies are listed 'Best First'.
Re^3: Can't find \x0D
by ikegami (Patriarch) on Feb 07, 2011 at 17:26 UTC

    Either you looked at the file using UltraEdit or you're running on AIX. Both aren't possible since UltraEdit doesn't run on AIX.

    Did you perhaps FTP the file between the two systems using ASC mode?