Hi Stuart,

Have a look on CPAN (www.cpan.org) there are two wonderfull packages to do
exactely what you are dreaming of :

Algorithm::Diff
Text::ParagraphDiff


Have a nice day
Michel



-----Message d'origine-----
De: Dan Anderson [mailto:[EMAIL PROTECTED]
Date: vendredi 23 janvier 2004 02:17
À: [EMAIL PROTECTED]
Cc: Perl Beginners
Objet: Re: Need help comparing lines in two files


Lets say file 1 is:

foo
bar
... continues on for 100 lines

And file 2 is:

foo
baz
bar
... continues on exactly the same 100 lines as file 1

Would file 2 be different from file 1 from line 2 and down?  Or would it
be different for line 2 and 3?

Also, the keywords:

next; Brings you to the next iteration in a loop
last; leaves the loop

Should help you iterate through a while loop (or empty loop)

i.e.

{
  # this is a loop, just two sets of brackets
  # put a last statement and it will leave.
  # put one of these in your for loops, or outside of your for loops.
}

Also you can get tricky by naming loops, i.e.:

FOO:
{
  print "foo";
  BAR:
  {
    last FOO;
  }
  # anything below here never executes
  print "bar";
}


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


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


Reply via email to