bruceleung2000
IS-IT--Management
Hello ALL,
I am a newbie to perl programming. I am trying to compare 2 strings read from separate files. It seems it the results are the same - cannot compare 2 same strings.
Can anyone tell me how to correct the following programs ?
=====
open (fh0, $fname0) or die "cannot read file $fname0" ; # $_[0] is first argument in the function
open (fh1, $fname1) or die "cannot read file $fname1" ;
sysread fh0, $instr0, $MAX_READ;
sysread fh1, $instr1, $MAX_READ;
if ( $instr0 =~ $instr1 ) { # ??????
print "eqqqqq char \n" ;
close fh0;
close fh1;
return $TRUE;
} # endif
close fh0;
close fh1;
print "NOTTTTTTTTT EQ char \n" ;
return $FALSE;
==================================
I am a newbie to perl programming. I am trying to compare 2 strings read from separate files. It seems it the results are the same - cannot compare 2 same strings.
Can anyone tell me how to correct the following programs ?
=====
open (fh0, $fname0) or die "cannot read file $fname0" ; # $_[0] is first argument in the function
open (fh1, $fname1) or die "cannot read file $fname1" ;
sysread fh0, $instr0, $MAX_READ;
sysread fh1, $instr1, $MAX_READ;
if ( $instr0 =~ $instr1 ) { # ??????
print "eqqqqq char \n" ;
close fh0;
close fh1;
return $TRUE;
} # endif
close fh0;
close fh1;
print "NOTTTTTTTTT EQ char \n" ;
return $FALSE;
==================================