J
Jay
Hi,
I'm trying to write a simple PERL parser that searches a given regexp
given a file. The types of files that I'm trying to search are over
10000 lines of code. Following is my code
print "Enter file name and location:";
chop($basfile = <STDIN>);
open INFILE, "< $basfile" or die "Can't open file:$basfile";
open OUTFILE, "> $basfile.out";
while(<INFILE>) {
$_;
print OUTFILE $_;
if($_ =~ m/ProcedureName/) {
print "$_\n";
break;
}
}
This seems to output stuff that is really crazy. It prints out a bunch
of ???????????? characters when viewed in EditPlus; these are chinese
characters when viewed in WordPad. I even try to do just simple input
and output (removed the if statement) and it still does that. Funny
thing is, if I take a subset of this file, then it seems to do the
correct output. What am I doing wrong? Any help will be very helpful.
Thank you.
Jay.
I'm trying to write a simple PERL parser that searches a given regexp
given a file. The types of files that I'm trying to search are over
10000 lines of code. Following is my code
print "Enter file name and location:";
chop($basfile = <STDIN>);
open INFILE, "< $basfile" or die "Can't open file:$basfile";
open OUTFILE, "> $basfile.out";
while(<INFILE>) {
$_;
print OUTFILE $_;
if($_ =~ m/ProcedureName/) {
print "$_\n";
break;
}
}
This seems to output stuff that is really crazy. It prints out a bunch
of ???????????? characters when viewed in EditPlus; these are chinese
characters when viewed in WordPad. I even try to do just simple input
and output (removed the if statement) and it still does that. Funny
thing is, if I take a subset of this file, then it seems to do the
correct output. What am I doing wrong? Any help will be very helpful.
Thank you.
Jay.