{
    "content": [
        {
            "type": "text",
            "text": "# Algorithm::DiffOld (perldoc)\n\n## NAME\n\nAlgorithm::DiffOld - Compute `intelligent' differences between two files / lists but use the old (<=0.59) interface.\n\n## SYNOPSIS\n\nuse Algorithm::DiffOld qw(diff LCS traversesequences);\n@lcs    = LCS( \\@seq1, \\@seq2, $comparisonfunction );\n$lcsref = LCS( \\@seq1, \\@seq2, $comparisonfunction );\n@diffs = diff( \\@seq1, \\@seq2, $comparisonfunction );\ntraversesequences( \\@seq1, \\@seq2,\n{ MATCH => $callback,\nDISCARDA => $callback,\nDISCARDB => $callback,\n},\n$comparisonfunction );\n\n## Sections\n\n- **NAME**\n- **NOTE**\n- **SYNOPSIS**\n- **COMPARISON FUNCTIONS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Algorithm::DiffOld",
        "section": "",
        "mode": "perldoc",
        "summary": "Algorithm::DiffOld - Compute `intelligent' differences between two files / lists but use the old (<=0.59) interface.",
        "synopsis": "use Algorithm::DiffOld qw(diff LCS traversesequences);\n@lcs    = LCS( \\@seq1, \\@seq2, $comparisonfunction );\n$lcsref = LCS( \\@seq1, \\@seq2, $comparisonfunction );\n@diffs = diff( \\@seq1, \\@seq2, $comparisonfunction );\ntraversesequences( \\@seq1, \\@seq2,\n{ MATCH => $callback,\nDISCARDA => $callback,\nDISCARDB => $callback,\n},\n$comparisonfunction );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "NOTE",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "COMPARISON FUNCTIONS",
                "lines": 28,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Algorithm::DiffOld - Compute `intelligent' differences between two files / lists but use the old\n(<=0.59) interface.\n",
                "subsections": []
            },
            "NOTE": {
                "content": "This has been provided as part of the Algorithm::Diff package by Ned Konz. This particular\nmodule is ONLY for people who HAVE to have the old interface, which uses a comparison function\nrather than a key generating function.\n\nBecause each of the lines in one array have to be compared with each of the lines in the other\narray, this does M*N comparisons. This can be very slow. I clocked it at taking 18 times as long\nas the stock version of Algorithm::Diff for a 4000-line file. It will get worse quadratically as\narray sizes increase.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Algorithm::DiffOld qw(diff LCS traversesequences);\n\n@lcs    = LCS( \\@seq1, \\@seq2, $comparisonfunction );\n\n$lcsref = LCS( \\@seq1, \\@seq2, $comparisonfunction );\n\n@diffs = diff( \\@seq1, \\@seq2, $comparisonfunction );\n\ntraversesequences( \\@seq1, \\@seq2,\n{ MATCH => $callback,\nDISCARDA => $callback,\nDISCARDB => $callback,\n},\n$comparisonfunction );\n",
                "subsections": []
            },
            "COMPARISON FUNCTIONS": {
                "content": "Each of the main routines should be passed a comparison function. If you aren't passing one in,\nuse Algorithm::Diff instead.\n\nThese functions should return a true value when two items should compare as equal.\n\nFor instance,\n\n@lcs    = LCS( \\@seq1, \\@seq2, sub { my ($a, $b) = @; $a eq $b } );\n\nbut if that is all you're doing with your comparison function, just use Algorithm::Diff and let\nit do this (this is its default).\n\nOr:\n\nsub someFunkyComparisonFunction\n{\nmy ($a, $b) = @;\n$a =~ m{$b};\n}\n\n@diffs = diff( \\@lines, \\@patterns, \\&someFunkyComparisonFunction );\n\nwhich would allow you to diff an array @lines which consists of text lines with an array\n@patterns which consists of regular expressions.\n\nThis is actually the reason I wrote this version -- there is no way to do this with a key\ngeneration function as in the stock Algorithm::Diff.\n",
                "subsections": []
            }
        }
    }
}