loody wrote:
Dear all:

Hello,

I try to write a perl to compare whether the line numbers of 2 files
is equivalent.
Below is my source code:

tie my @src_file,'Tie::File', $src_file, mode => O_RDWR ,autochomp =>
1 or die "cannot open file $!";
tie my @src_file,'Tie::File', $src_file, mode => O_RDWR ,autochomp =>
1 or die "cannot open file $!";
if($#src_file != $#src_file)
{
        printf "The 2 files line numbers are different\n";
        exit;
}

but I find the time will be quite long when these 2 files are large,
each about 12MB.
I there quicker way to meet the same requirement?

perldoc -q "How do I count the number of lines in a file"


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to