in reply to Re: comparing contents of the file
in thread comparing contents of the file
and i am getting this error: Global symbol "$lines" requires explicit package name at line.pl line 21,22,26. i am gng throu the tutorials..#!/usr/bin/perl use strict; use warnings; my %lines; open F1, "File.txt"; while(my $result= <F1>) { $lines{$result}=1; } close(F1); open (OF1, ">match.txt"); open (OF2, ">diff.txt"); open F2,"File2.txt"; while(<F2>) { if ($lines{$_}==1) { print OF1 $lines; $lines++; } els { print OF2 $lines; } } close OF1; close OF2;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: comparing contents of the file
by toolic (Bishop) on Jun 04, 2008 at 15:35 UTC | |
by Ms.Ranjan (Initiate) on Jun 04, 2008 at 16:21 UTC | |
by toolic (Bishop) on Jun 04, 2008 at 16:38 UTC | |
by Ms.Ranjan (Initiate) on Jun 04, 2008 at 21:03 UTC | |
by graff (Chancellor) on Jun 04, 2008 at 23:27 UTC | |
|