소스 검색

Removing old stuff from root folder.

avkonst 12 년 전
부모
커밋
6e5e36dbf7
9개의 변경된 파일0개의 추가작업 그리고 8281개의 파일을 삭제
  1. 0 91
      lib/Internal/Output.pm
  2. 0 1030
      lib/SWI/Appraiser.pm
  3. 0 351
      lib/SWI/Converter.pm
  4. 0 740
      lib/SWI/Launcher.pm
  5. 0 105
      lib/SWI/Merger.pm
  6. 0 1710
      lib/SWI/Processor.pm
  7. 0 324
      lib/String/CRC/Cksum.pm
  8. 0 3284
      lib/XML/Simple.pm
  9. 0 646
      lib/XML/Simple/FAQ.pod

+ 0 - 91
lib/Internal/Output.pm

@@ -1,91 +0,0 @@
-#
-#    Software Index, Copyright 2010, Software Index Project Team
-#    Link: http://swi.sourceforge.net
-#
-#    This file is part of Software Index Tool.
-#
-#    Software Index is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, version 3 of the License.
-#
-#    Software Index is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with Software Index.  If not, see <http://www.gnu.org/licenses/>.
-#
-package Internal::Output;
-
-use strict;
-
-require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $PREFERRED_PARSER);
-@ISA              = qw(Exporter);
-@EXPORT           = qw(DEBUG_ENABLED DEBUG STATUS PRINT);
-@EXPORT_OK        = qw(DEBUG_ENABLED DEBUG STATUS PRINT);
-$VERSION          = '1.0';
-$PREFERRED_PARSER = undef;
-
-#
-# Global variables
-#
-my $globalDebugEnabled = 0;
-
-#
-# Interfaces to get/set internal variables
-#
-
-sub DEBUG_ENABLED
-{
-    if (@_)
-    {
-        $globalDebugEnabled = shift();
-    }
-    return $globalDebugEnabled;
-}
-
-#
-# Interfaces to dump/print/publish the information
-#
-
-sub DEBUG
-{
-    my $text = shift();
-    if ( $globalDebugEnabled != 0 )
-    {
-        print "[SWI DEBUG  MESSAGE]: $text\n";
-    }
-}
-
-sub STATUS
-{
-    my $text = shift();
-    
-    print "[SWI STATUS MESSAGE]: $text\n";
-}
-
-sub PRINT
-{
-    my $file = shift();
-    my $line = shift();
-    my $severity = shift();
-    my $text = shift();
-    
-    $severity = lc $severity;
-    
-    if ( $severity ne 'debug' || $globalDebugEnabled != 0 )
-    {
-        if ($severity eq 'debug')
-        {
-            print STDOUT "$file:$line: $severity: $text\n";
-        }
-        elsif($severity eq 'error' || $severity eq 'warning' || $severity eq 'notice' || $severity eq 'info')
-        {
-            print STDERR "$file:$line: $severity: $text\n";
-        }
-    }
-}
-
-return 1;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 1030
lib/SWI/Appraiser.pm


+ 0 - 351
lib/SWI/Converter.pm

@@ -1,351 +0,0 @@
-#
-#    Software Index, Copyright 2010, Software Index Project Team
-#    Link: http://swi.sourceforge.net
-#
-#    This file is part of Software Index Tool.
-#
-#    Software Index is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, version 3 of the License.
-#
-#    Software Index is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with Software Index.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-use strict;
-use XML::Simple;
-use FileHandle;
-use Data::Dumper;
-
-#
-# Export section
-#
-require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $PREFERRED_PARSER);
-@ISA              = qw(Exporter);
-@EXPORT           = qw(swiConvert);
-@EXPORT_OK        = qw();
-$VERSION          = '1.0';
-$PREFERRED_PARSER = undef;
-
-#
-# Global variables
-#
-my $config = undef;
-
-#
-# Enter point
-#
-sub swiConvert
-{
-    $config = shift();
-
-    my $report   = undef;
-    my $exitCode = 0;
-
-    $report = XMLin(
-        $config->{"swi:report"}->{"swi:destination"} . "/"
-          . $config->{"swi:report"}->{"swi:xml"}->{"swi:name"},
-        ForceArray =>
-          [ "swi:module", "swi:file", "swi:function", "swi:reference" ]
-    );
-
-    # generate notification report
-    my $fh = new FileHandle(
-        $config->{"swi:report"}->{"swi:destination"} . "/"
-          . $config->{"swi:report"}->{"swi:notifications"}->{"swi:name"},
-        "w"
-      )
-      or die("Can not open output file!");
-
-    my $projectStat     = $report->{"swi:statistic"};
-    my $projectName     = $config->{"swi:info"}->{"swi:project"}->{"swi:name"};
-    my $projectLocation = $config->{"swi:report"}->{"swi:destination"};
-    my $projectDiff     = "modified";
-    $exitCode +=
-      swiNotificationPrint( $fh, $projectName, $projectLocation, undef,
-        $projectStat, $projectDiff );
-    for (
-        my $moduleId = 0 ;
-        $moduleId <= $#{ $report->{"swi:module"} } ;
-        $moduleId++
-      )
-    {
-        my $moduleStat = $report->{"swi:module"}[$moduleId]->{"swi:statistic"};
-        my $moduleName = $report->{"swi:module"}[$moduleId]->{"swi:name"};
-        my $moduleLocation =
-          $report->{"swi:module"}[$moduleId]->{"swi:location"};
-        my $moduleDiff =
-          $report->{"swi:module"}[$moduleId]->{"swi:modification"};
-        $exitCode +=
-          swiNotificationPrint( $fh, $projectName . "/" . $moduleName,
-            $moduleLocation, undef, $moduleStat, $moduleDiff );
-        for (
-            my $fileId = 0 ;
-            $fileId <= $#{ $report->{"swi:module"}[$moduleId]->{"swi:file"} } ;
-            $fileId++
-          )
-        {
-            my $fileStat =
-              $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
-              ->{"swi:statistic"};
-            my $fileName =
-              $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
-              ->{"swi:name"};
-            my $fileLocation =
-              $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
-              ->{"swi:location"};
-            my $fileDiff =
-              $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
-              ->{"swi:modification"};
-            $exitCode += swiNotificationPrint(
-                $fh, $projectName . "/" . $moduleName . "/" . $fileName,
-                $moduleLocation, $fileLocation . ":0",
-                $fileStat, $fileDiff
-            );
-            for (
-                my $functionId = 0 ;
-                $functionId <= $#{
-                    $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
-                      ->{"swi:function"}
-                } ;
-                $functionId++
-              )
-            {
-                my $functionRefs =
-                  $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
-                  ->{"swi:function"}[$functionId]->{"swi:reference"};
-                my $functionStat =
-                  $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
-                  ->{"swi:function"}[$functionId]->{"swi:statistic"};
-                my $functionName =
-                  $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
-                  ->{"swi:function"}[$functionId]->{"swi:name"};
-                my $functionLocation =
-                  $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
-                  ->{"swi:function"}[$functionId]->{"swi:location"};
-                my $functionDiff =
-                  $report->{"swi:module"}[$moduleId]->{"swi:file"}[$fileId]
-                  ->{"swi:function"}[$functionId]->{"swi:modification"};
-                $exitCode += swiNotificationPrint(
-                    $fh,
-                    $projectName . "/"
-                      . $moduleName . "/"
-                      . $fileName . "/"
-                      . $functionName,
-                    $moduleLocation,
-                    $functionLocation,
-                    $functionStat,
-                    $functionDiff,
-                    $functionRefs
-                );
-            }
-        }
-    }
-    $fh->close();
-
-    $fh = new FileHandle(
-        $config->{"swi:report"}->{"swi:destination"} . "/"
-          . $config->{"swi:report"}->{"swi:notifications"}->{"swi:name"},
-        "r"
-      )
-      or die("Can not open input file!");
-
-    while (<$fh>)
-    {
-        print STDERR $_;
-    }
-    $fh->close();
-
-    return $exitCode;
-}
-
-sub swiNotificationPrint
-{
-    my $file         = shift();
-    my $objName      = shift();
-    my $modLocation  = shift();
-    my $fileLocation = shift();
-    my $objStat      = shift();
-    my $objDiff      = shift();
-    my $objRefs      = shift();
-    my $returnCode   = 0;
-
-    if ( !defined($fileLocation) )
-    {
-        $fileLocation = ".";
-    }
-
-    # Print 'swi:modifications'
-    if (   $objDiff ne "unmodified"
-        && $config->{"swi:report"}->{"swi:notifications"}->{"swi:print"}
-        ->{ "swi:" . $objDiff }->{"swi:modifications"} eq "on" )
-    {
-        my $notification =
-            "$modLocation/$fileLocation: " . "info"
-          . ": Object "
-          . $objName
-          . " has been "
-          . $objDiff
-          . "\n\tObject         : "
-          . $objName . "\n";
-        print $file $notification;
-        print $file "\n";
-    }
-
-    # Print 'swi:failures'
-    my $areThereDupViolations = 0;
-    foreach my $keyStat ( keys %$objStat )
-    {
-        my $subStat = $objStat->{$keyStat};
-        foreach my $keySubStat ( keys %$subStat )
-        {
-            my $types = $objStat->{$keyStat}->{$keySubStat};
-            foreach my $type ( keys %$types )
-            {
-                my $statInfo = $objStat->{$keyStat}->{$keySubStat}->{$type};
-                if (
-                    !(
-                        $statInfo->{"swi:level"} eq $statInfo->{"swi:suppress"}
-                        || (   $statInfo->{"swi:level"} eq "regular"
-                            && $statInfo->{"swi:suppress"} eq "undefined" )
-                    )
-                  )
-                {
-                    my $notification =
-                        "$modLocation/$fileLocation: "
-                      . $statInfo->{"swi:level"}
-                      . ": Index '"
-                      . "$keyStat/$keySubStat/$type"
-                      . "' exceeds the limit"
-                      . "\n\tObject         : "
-                      . $objName
-                      . "\n\tIndex value    : "
-                      . $statInfo->{"content"}
-                      . "\n\tModification   : "
-                      . $objDiff . " / "
-                      . $statInfo->{"swi:change"}
-                      . "\n\tSeverity       : "
-                      . $statInfo->{"swi:level"}
-                      . "\n\tCriteria       : "
-                      . $statInfo->{"swi:criteria"}
-                      . "\n\tSuppress level : "
-                      . $statInfo->{"swi:suppress"} . "\n";
-
-                    if ( $config->{"swi:report"}->{"swi:notifications"}
-                        ->{"swi:print"}->{ "swi:" . $objDiff }->{"swi:failures"}
-                        eq "on" )
-                    {
-                        print $file $notification;
-                        print $file "\n";
-
-                        if (   $keyStat eq "swi:duplication"
-                            && $keySubStat eq "swi:symbols"
-                            && $type       eq 'swi:exact' )
-                        {
-                            $areThereDupViolations = 1;
-                        }
-                    }
-
-                    if ( $config->{"swi:report"}->{"swi:notifications"}
-                        ->{"swi:error"}->{ "swi:" . $objDiff } eq "on" )
-                    {
-                        $returnCode++;
-                    }
-                }
-                if (   $statInfo->{"swi:level"} eq "unresolved"
-                    || $statInfo->{"swi:suppress"} eq "unresolved" )
-                {
-                    my $notification =
-                        "$modLocation/$fileLocation: "
-                      . $statInfo->{"swi:level"}
-                      . ": The level/severity of index '"
-                      . "$keyStat/$keySubStat/$type"
-                      . "' is unresolved"
-                      . "\n\tObject         : "
-                      . $objName
-                      . "\n\tIndex value    : "
-                      . $statInfo->{"content"}
-                      . "\n\tModification   : "
-                      . $objDiff . " / "
-                      . $statInfo->{"swi:change"}
-                      . "\n\tSeverity       : "
-                      . $statInfo->{"swi:level"}
-                      . "\n\tCriteria       : "
-                      . $statInfo->{"swi:criteria"}
-                      . "\n\tSuppress level : "
-                      . $statInfo->{"swi:suppress"} . "\n\n";
-
-                    print $file $notification;
-                    $returnCode++;
-                }
-            }
-        }
-    }
-
-    # Print 'swi:duplications'
-    if (
-        $areThereDupViolations == 1
-        || $config->{"swi:report"}->{"swi:notifications"}->{"swi:print"}
-        ->{ "swi:" . $objDiff }->{"swi:duplications"} eq "on"
-      )
-    {
-        my $isPrinted = 0;
-        foreach my $dupData ( @{$objRefs} )
-        {
-            if ( $dupData->{'swi:ref:type'} eq 'dup' )
-            {
-                print $file $modLocation . "/"
-                  . $dupData->{'swi:dup:file'} . ":"
-                  . $dupData->{'swi:dup:line'}
-                  . ": warning: '"
-                  . $dupData->{'swi:dup:size'}
-                  . "' executable symbols are duplicated in '"
-                  . $dupData->{'swi:dup:function'}
-                  . "' function\n";
-                $isPrinted = 1;
-            }
-        }
-        if ($isPrinted == 1)
-        {
-            print $file "\n";
-        }
-    }
-
-    # Print 'swi:scanmessages'
-    if ( $config->{"swi:report"}->{"swi:notifications"}->{"swi:print"}
-        ->{ "swi:" . $objDiff }->{"swi:scanmessages"} eq "on" )
-    {
-        foreach my $scanData ( @{$objRefs} )
-        {
-            if (
-                $scanData->{'swi:ref:type'} eq 'scan'
-                && !(
-                    defined( $scanData->{'swi:scan:suppress'} )
-                    && $scanData->{'swi:scan:suppress'} eq 'on'
-                )
-              )
-            {
-                print $file $modLocation . "/"
-                  . $scanData->{'swi:scan:file'} . ":"
-                  . $scanData->{'swi:scan:line'}
-                  . ": warning: "
-                  . $scanData->{'swi:scan:message'}
-                  . "\n\tObject         : "
-                  . $objName
-                  . "\n\tModification   : "
-                  . $objDiff . "\n\n";
-                $returnCode++;
-            }
-        }
-    }
-
-    return $returnCode;
-}
-
-return 1;

+ 0 - 740
lib/SWI/Launcher.pm

@@ -1,740 +0,0 @@
-#
-#    Software Index, Copyright 2010, Software Index Project Team
-#    Link: http://swi.sourceforge.net
-#
-#    This file is part of Software Index Tool.
-#
-#    Software Index is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, version 3 of the License.
-#
-#    Software Index is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with Software Index.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-use strict;
-use XML::Simple;
-use FileHandle;
-
-#
-# Export section
-#
-require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $PREFERRED_PARSER);
-@ISA              = qw(Exporter);
-@EXPORT           = qw(swiLaunch);
-@EXPORT_OK        = qw();
-$VERSION          = '1.0';
-$PREFERRED_PARSER = undef;
-
-#
-# Subroutine for troubleshooting purposes
-#
-use Internal::Output;
-
-#
-# Include SWI libs
-#
-require SWI::Appraiser;
-require SWI::Converter;
-require SWI::Merger;
-require SWI::Processor;
-
-#
-# Global variables
-#
-my $config = undef;
-
-#
-# Enter point
-#
-sub swiLaunch
-{
-    my $returnCode       = 0;
-    my $rootLocation     = shift();
-    my $swiConfiguration = shift();
-
-    # $returnCode == 0 => no critical errors and warnings
-    # $returnCode >  0 => no critical errors, there are warnings
-    # $returnCode <  0 => there are critical errors
-
-    if ( $returnCode >= 0 )
-    {
-        if ( $swiConfiguration eq "" )
-        {
-            STATUS("Configuration file should be specified!");
-            $returnCode = -1;
-        }
-        else
-        {
-            STATUS("Configuration file: $swiConfiguration.");
-        }
-    }
-
-    if ( $returnCode >= 0 )
-    {
-        if ( swiConfigurationValidate($swiConfiguration) != 0 )
-        {
-            STATUS("Wrong configuration file!");
-            $returnCode = -2;
-        }
-    }
-
-    if ( $returnCode >= 0 )
-    {
-
-        # Generate report for every module separately
-        for (
-            my $i = 0 ;
-            $i <= $#{ $config->{"swi:modules"}->{"swi:module"} } ;
-            $i++
-          )
-        {
-            STATUS( "Processing module: '"
-                  . $config->{"swi:modules"}->{"swi:module"}[$i]->{"swi:name"}
-                  . "'." );
-            my $result = swiProcess( $config, $i, $rootLocation );
-            if ( $result < 0 )
-            {
-                STATUS("The are problems to report the index for the module!");
-                $returnCode = -5;
-            }
-            elsif ( $result > 0 )
-            {
-                STATUS("The are scan warnings and/or errors.");
-                $returnCode += $result;
-            }
-            else
-            {
-                STATUS("The module has been processed succesfully.");
-            }
-        }
-    }
-
-    if ( $returnCode >= 0 )
-    {
-
-        # Merge reports
-        if ( swiMerge($config) )
-        {
-            STATUS("The are problems to merge files to one report!");
-            $returnCode = -3;
-        }
-        else
-        {
-            STATUS("Merged report has been created.");
-        }
-    }
-
-    if ( $returnCode >= 0 )
-    {
-
-        # Add average/min/max/total values and generate final XML report
-        if ( swiAppraise($config) )
-        {
-            STATUS("The are problems to add average/min/max/total values!");
-            $returnCode = -4;
-        }
-        else
-        {
-            STATUS("Average/min/max/total values have been added.");
-        }
-    }
-
-    if ( $returnCode >= 0 )
-    {
-
-        # Convert results
-        my $result = swiConvert($config);
-        if ( $result < 0 )
-        {
-            STATUS("The are problems to convert the report!");
-            $returnCode = -5;
-        }
-        elsif ( $result > 0 )
-        {
-            STATUS(
-                "Report has been converted. There are exceeded limitations.");
-            $returnCode += $result;
-        }
-        else
-        {
-            STATUS("Report has been converted.");
-        }
-    }
-
-    STATUS("Execution completed with exit code '$returnCode'.");
-    return $returnCode;
-}
-
-sub swiConfigurationValidate
-{
-    my $result = 0;
-    $config =
-      XMLin( shift(),
-        ForceArray => [ "swi:module", "swi:rule", "swi:pattern" ] );
-
-    if ( !defined( $config->{'swi:info'} ) )
-    {
-        STATUS("Wrong configuration: 'swi:info' section missed.");
-        $result++;
-    }
-    else
-    {
-        if ( !defined( $config->{'swi:info'}->{'swi:version'} ) )
-        {
-            STATUS(
-                "Wrong configuration: 'swi:info/swi:version' section missed.");
-            $result++;
-        }
-        elsif ( $config->{'swi:info'}->{'swi:version'} != 1 )
-        {
-            STATUS(
-"Wrong configuration: Unsupported version of the configuration file. Check 'swi:info/swi:version' section."
-            );
-            $result++;
-        }
-
-        if ( !defined( $config->{'swi:info'}->{'swi:project'} ) )
-        {
-            STATUS(
-                "Wrong configuration: 'swi:info/swi:project' section missed.");
-            $result++;
-        }
-        else
-        {
-            if (
-                !defined(
-                    $config->{'swi:info'}->{'swi:project'}->{'swi:name'}
-                )
-              )
-            {
-                STATUS(
-"Wrong configuration: 'swi:info/swi:project/swi:name' section missed."
-                );
-                $result++;
-            }
-            elsif ( $config->{'swi:info'}->{'swi:project'}->{'swi:name'} eq "" )
-            {
-                STATUS(
-"Wrong configuration: 'swi:info/swi:project/swi:name' is empty."
-                );
-                $result++;
-            }
-        }
-    }
-
-    if ( !defined( $config->{'swi:general'} )
-        || ref( $config->{'swi:general'} ) ne 'HASH' )
-    {
-        $config->{'swi:general'} = {};
-    }
-    if ( !defined( $config->{'swi:general'}->{'swi:debug'} )
-        || ref( $config->{'swi:general'}->{'swi:debug'} ) ne 'HASH' )
-    {
-        $config->{'swi:general'}->{'swi:debug'} = {};
-    }
-    if ( !defined( $config->{'swi:general'}->{'swi:debug'}->{'swi:enabled'} ) )
-    {
-        $config->{'swi:general'}->{'swi:debug'}->{'swi:enabled'} = 'off';
-    }
-    DEBUG_ENABLED(
-        ( $config->{'swi:general'}->{'swi:debug'}->{'swi:enabled'} eq 'on' )
-        ? 1
-        : 0
-    );
-
-    if ( !defined( $config->{'swi:modules'} )
-        || ref( $config->{'swi:modules'} ) ne 'HASH' )
-    {
-        STATUS("Wrong configuration: 'swi:modules' section missed.");
-        $result++;
-    }
-    else
-    {
-        if ( !defined( $config->{'swi:modules'}->{'swi:module'} )
-            || ref( $config->{'swi:modules'}->{'swi:module'} ) ne 'ARRAY' )
-        {
-            STATUS(
-                "Wrong configuration: 'swi:modules/swi:module' section missed."
-            );
-            $result++;
-        }
-        else
-        {
-            my $moduleId = 0;
-            foreach my $module ( @{ $config->{'swi:modules'}->{'swi:module'} } )
-            {
-                if ( !defined( $module->{'swi:name'} ) )
-                {
-                    STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:name' section missed."
-                    );
-                    $result++;
-                }
-                if ( !defined( $module->{'swi:location'} ) )
-                {
-                    STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:location' section missed."
-                    );
-                    $result++;
-                }
-
-                if ( !defined( $module->{'swi:files'} )
-                    || ref( $module->{'swi:files'} ) ne 'HASH' )
-                {
-                    $module->{'swi:files'} = {};
-                }
-                if ( !defined( $module->{'swi:files'}->{'swi:include'} ) )
-                {
-                    $module->{'swi:files'}->{'swi:include'} = '.*';
-                }
-                if ( !defined( $module->{'swi:files'}->{'swi:exclude'} ) )
-                {
-                    $module->{'swi:files'}->{'swi:exclude'} = '';
-                }
-
-                if ( !defined( $module->{'swi:preprocessor'} )
-                    || ref( $module->{'swi:preprocessor'} ) ne 'HASH' )
-                {
-                    $module->{'swi:preprocessor'} = {};
-                }
-                if ( !defined( $module->{'swi:preprocessor'}->{'swi:rule'} ) )
-                {
-                    $module->{'swi:preprocessor'}->{'swi:rule'} = [];
-                }
-
-                my $ruleId = 0;
-                foreach
-                  my $rule ( @{ $module->{'swi:preprocessor'}->{'swi:rule'} } )
-                {
-                    if ( !defined( $rule->{'swi:filepattern'} )
-                        || $rule->{'swi:filepattern'} eq "" )
-                    {
-                        STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:preprocessor/swi:rule[$ruleId]/swi:filepattern' section missed."
-                        );
-                        $result++;
-                    }
-                    if ( !defined( $rule->{'swi:searchpattern'} )
-                        || $rule->{'swi:searchpattern'} eq "" )
-                    {
-                        STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:preprocessor/swi:rule[$ruleId]/swi:searchpattern' section missed."
-                        );
-                        $result++;
-                    }
-                    if ( !defined( $rule->{'swi:replacepattern'} )
-                        || $rule->{'swi:replacepattern'} eq "" )
-                    {
-                        STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:preprocessor/swi:rule[$ruleId]/swi:replacepattern' section missed."
-                        );
-                        $result++;
-                    }
-
-                    $ruleId++;
-                }
-
-                if ( !defined( $module->{'swi:scanner'} )
-                    || ref( $module->{'swi:scanner'} ) ne 'HASH' )
-                {
-                    $module->{'swi:scanner'} = {};
-                }
-                if ( !defined( $module->{'swi:scanner'}->{'swi:rule'} ) )
-                {
-                    $module->{'swi:scanner'}->{'swi:rule'} = [];
-                }
-
-                $ruleId = 0;
-                foreach my $rule ( @{ $module->{'swi:scanner'}->{'swi:rule'} } )
-                {
-                    if ( !defined( $rule->{'swi:filepattern'} )
-                        || $rule->{'swi:filepattern'} eq "" )
-                    {
-                        STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:rule[$ruleId]/swi:filepattern' section missed."
-                        );
-                        $result++;
-                    }
-                    if ( !defined( $rule->{'swi:searchpattern'} )
-                        || $rule->{'swi:searchpattern'} eq "" )
-                    {
-                        STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:rule[$ruleId]/swi:searchpattern' section missed."
-                        );
-                        $result++;
-                    }
-                    if ( !defined( $rule->{'swi:messagepattern'} )
-                        || $rule->{'swi:messagepattern'} eq "" )
-                    {
-                        STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:rule[$ruleId]/swi:messagepattern' section missed."
-                        );
-                        $result++;
-                    }
-
-                    if ( !defined( $rule->{'swi:codecontent'} )
-                        || $rule->{'swi:codecontent'} eq "" )
-                    {
-                        $rule->{'swi:codecontent'} = 'purified';
-                    }
-
-                    $ruleId++;
-                }
-
-                if ( !defined( $module->{'swi:scanner'}->{'swi:suppress'} ) )
-                {
-                    $module->{'swi:scanner'}->{'swi:suppress'} = {};
-                }
-                if (
-                    !defined(
-                        $module->{'swi:scanner'}->{'swi:suppress'}
-                          ->{'swi:pattern'}
-                    )
-                  )
-                {
-                    $module->{'swi:scanner'}->{'swi:suppress'}
-                      ->{'swi:pattern'} = [];
-                }
-
-                my $patternId = 0;
-                foreach my $pattern (
-                    @{
-                        $module->{'swi:scanner'}->{'swi:suppress'}
-                          ->{'swi:pattern'}
-                    }
-                  )
-                {
-                    if ( ref($pattern) ne 'HASH' )
-                    {
-                        STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:suppress/swi:pattern[$patternId]' section is incorrect."
-                        );
-                        $result++;
-                    }
-                    else
-                    {
-                        if ( !defined( $pattern->{'swi:message'} )
-                            || $pattern->{'swi:message'} eq "" )
-                        {
-                            STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:suppress/swi:pattern[$patternId]/swi:message' field is empty."
-                            );
-                            $result++;
-                        }
-                        if ( !defined( $pattern->{'content'} )
-                            || $pattern->{'content'} eq "" )
-                        {
-                            STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:scanner/swi:suppress/swi:pattern[$patternId]' object pattern is empty."
-                            );
-                            $result++;
-                        }
-                    }
-
-                    $patternId++;
-                }
-
-                if ( !defined( $module->{'swi:indexer:common'} )
-                    || ref( $module->{'swi:indexer:common'} ) ne 'HASH' )
-                {
-                    $module->{'swi:indexer:common'} = {};
-                }
-
-                if ( !defined( $module->{'swi:indexer:dup'} )
-                    || ref( $module->{'swi:indexer:dup'} ) ne 'HASH' )
-                {
-                    $module->{'swi:indexer:dup'} = {};
-                }
-                if (
-                    !defined(
-                        $module->{'swi:indexer:dup'}->{'swi:codecontent'}
-                    )
-                  )
-                {
-                    $module->{'swi:indexer:dup'}->{'swi:codecontent'} =
-                      'purified';
-                }
-                if ( !defined( $module->{'swi:indexer:dup'}->{'swi:enabled'} ) )
-                {
-                    $module->{'swi:indexer:dup'}->{'swi:enabled'} = 'on';
-                }
-                if ( !defined( $module->{'swi:indexer:dup'}->{'swi:minlength'} )
-                  )
-                {
-                    $module->{'swi:indexer:dup'}->{'swi:minlength'} = 100;
-                }
-                if ( $module->{'swi:indexer:dup'}->{'swi:minlength'} <= 0 )
-                {
-                    STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:indexer:dup/swi:minlength' can not be less than or equal to zero."
-                    );
-                    $result++;
-                }
-                if ( !defined( $module->{'swi:indexer:dup'}->{'swi:proximity'} )
-                  )
-                {
-                    $module->{'swi:indexer:dup'}->{'swi:proximity'} = 100;
-                }
-                if (   $module->{'swi:indexer:dup'}->{'swi:proximity'} <= 0
-                    || $module->{'swi:indexer:dup'}->{'swi:proximity'} > 100 )
-                {
-                    STATUS(
-"Wrong configuration: 'swi:modules/swi:module[$moduleId]/swi:indexer:dup/swi:proximity' should be in the range from 1 till 100."
-                    );
-                    $result++;
-                }
-                if (
-                    !defined(
-                        $module->{'swi:indexer:dup'}->{'swi:globalcode'}
-                    )
-                  )
-                {
-                    $module->{'swi:indexer:dup'}->{'swi:globalcode'} = 'off';
-                }
-
-                if ( !defined( $module->{'swi:indexer:gcov'} )
-                    || ref( $module->{'swi:indexer:gcov'} ) ne 'HASH' )
-                {
-                    $module->{'swi:indexer:gcov'} = {};
-                }
-                if ( !defined( $module->{'swi:indexer:gcov'}->{'swi:enabled'} ) )
-                {
-                    $module->{'swi:indexer:gcov'}->{'swi:enabled'} = 'off';
-                }
-                if ( !defined( $module->{'swi:indexer:gcov'}->{'swi:filepattern'} ) )
-                {
-                    $module->{'swi:indexer:gcov'}->{'swi:filepattern'} = '.*';
-                }
-                if ( !defined( $module->{'swi:indexer:gcov'}->{'swi:sourcefile'} ) )
-                {
-                    $module->{'swi:indexer:gcov'}->{'swi:sourcefile'} = '(.*)[.][cChH][pP]?[pP]?';
-                }
-                if ( !defined( $module->{'swi:indexer:gcov'}->{'swi:gcdafile'} ) )
-                {
-                    $module->{'swi:indexer:gcov'}->{'swi:gcdafile'} = '${1}.gcda';
-                }
-
-                $moduleId++;
-            }
-        }
-    }
-
-    if ( !defined( $config->{'swi:report'} )
-        || ref( $config->{'swi:report'} ) ne 'HASH' )
-    {
-        STATUS("Wrong configuration: 'swi:report' section missed.");
-        $result++;
-    }
-    else
-    {
-        if ( !defined( $config->{'swi:report'}->{'swi:destination'} ) )
-        {
-            STATUS(
-"Wrong configuration: 'swi:report/swi:destination' section missed."
-            );
-            $result++;
-        }
-
-        if ( !defined( $config->{'swi:report'}->{'swi:xml'} ) )
-        {
-            STATUS("Wrong configuration: 'swi:report/swi:xml' section missed.");
-            $result++;
-        }
-        else
-        {
-            if (
-                !defined( $config->{'swi:report'}->{'swi:xml'}->{'swi:name'} ) )
-            {
-                STATUS(
-"Wrong configuration: 'swi:report/swi:xml/swi:name' section is empty."
-                );
-                $result++;
-            }
-        }
-
-        if ( !defined( $config->{'swi:report'}->{'swi:notifications'} ) )
-        {
-            STATUS(
-"Wrong configuration: 'swi:report/swi:notifications' section missed."
-            );
-            $result++;
-        }
-        else
-        {
-            if (
-                !defined(
-                    $config->{'swi:report'}->{'swi:notifications'}->{'swi:name'}
-                )
-              )
-            {
-                STATUS(
-"Wrong configuration: 'swi:report/swi:notifications/swi:name' section is empty."
-                );
-                $result++;
-            }
-
-            if (
-                !defined(
-                    $config->{'swi:report'}->{'swi:notifications'}
-                      ->{'swi:error'}
-                )
-                || ref(
-                    $config->{'swi:report'}->{'swi:notifications'}
-                      ->{'swi:error'}
-                ) ne 'HASH'
-              )
-            {
-                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'} =
-                  {};
-            }
-            if (
-                !defined(
-                    $config->{'swi:report'}->{'swi:notifications'}
-                      ->{'swi:error'}->{'swi:added'}
-                )
-              )
-            {
-                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
-                  ->{'swi:added'} = 'on';
-            }
-            if (
-                !defined(
-                    $config->{'swi:report'}->{'swi:notifications'}
-                      ->{'swi:error'}->{'swi:removed'}
-                )
-              )
-            {
-                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
-                  ->{'swi:removed'} = 'on';
-            }
-            if (
-                !defined(
-                    $config->{'swi:report'}->{'swi:notifications'}
-                      ->{'swi:error'}->{'swi:modified'}
-                )
-              )
-            {
-                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
-                  ->{'swi:modified'} = 'on';
-            }
-            if (
-                !defined(
-                    $config->{'swi:report'}->{'swi:notifications'}
-                      ->{'swi:error'}->{'swi:cloned'}
-                )
-              )
-            {
-                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
-                  ->{'swi:cloned'} = 'on';
-            }
-            if (
-                !defined(
-                    $config->{'swi:report'}->{'swi:notifications'}
-                      ->{'swi:error'}->{'swi:unmodified'}
-                )
-              )
-            {
-                $config->{'swi:report'}->{'swi:notifications'}->{'swi:error'}
-                  ->{'swi:unmodified'} = 'on';
-            }
-
-            if (
-                !defined(
-                    $config->{'swi:report'}->{'swi:notifications'}
-                      ->{'swi:print'}
-                )
-                || ref(
-                    $config->{'swi:report'}->{'swi:notifications'}
-                      ->{'swi:print'}
-                ) ne 'HASH'
-              )
-            {
-                $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'} =
-                  {};
-            }
-            swiUtilConfigFill_PrintSection($config, 'swi:added');
-            swiUtilConfigFill_PrintSection($config, 'swi:removed');
-            swiUtilConfigFill_PrintSection($config, 'swi:modified');
-            swiUtilConfigFill_PrintSection($config, 'swi:cloned');
-            swiUtilConfigFill_PrintSection($config, 'swi:unmodified');
-            
-        }
-    }
-    
-    # swi:limits section is verified in runtime
-    # no precheck currently 
-
-    DEBUG( "Configuration structure is: " . Dumper($config) );
-    return $result;
-}
-
-sub swiUtilConfigFill_PrintSection
-{
-    my $config  = shift();
-    my $modType = shift();
-
-    if (
-        !defined(
-            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-              ->{$modType}
-        )
-        || ref(
-            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-              ->{$modType}
-        ) ne 'HASH'
-      )
-    {
-        $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-          ->{$modType} = {};
-    }
-    
-    if (
-        !defined(
-            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-              ->{$modType}->{'swi:failures'}
-        )
-      )
-    {
-        $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-          ->{$modType}->{'swi:failures'} = 'on';
-    }
-    if (
-        !defined(
-            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-              ->{$modType}->{'swi:modifications'}
-        )
-      )
-    {
-        $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-          ->{$modType}->{'swi:modifications'} = 'on';
-    }
-    if (
-        !defined(
-            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-              ->{$modType}->{'swi:duplications'}
-        )
-      )
-    {
-        $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-          ->{$modType}->{'swi:duplications'} = 'off';
-    }
-    if (
-        !defined(
-            $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-              ->{$modType}->{'swi:scanmessages'}
-        )
-      )
-    {
-        $config->{'swi:report'}->{'swi:notifications'}->{'swi:print'}
-          ->{$modType}->{'swi:scanmessages'} = 'on';
-    }
-}
-
-return 1;

+ 0 - 105
lib/SWI/Merger.pm

@@ -1,105 +0,0 @@
-#
-#    Software Index, Copyright 2010, Software Index Project Team
-#    Link: http://swi.sourceforge.net
-#
-#    This file is part of Software Index Tool.
-#
-#    Software Index is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, version 3 of the License.
-#
-#    Software Index is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with Software Index.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-use strict;
-use FileHandle;
-use XML::Simple;
-
-#
-# Export section
-#
-require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $PREFERRED_PARSER);
-@ISA              = qw(Exporter);
-@EXPORT           = qw(swiMerge);
-@EXPORT_OK        = qw();
-$VERSION          = '1.0';
-$PREFERRED_PARSER = undef;
-
-#
-# Enter point
-#
-sub swiMerge
-{
-    my $config         = shift();
-    
-    my $reportLocation =
-        $config->{"swi:report"}->{"swi:destination"} . "/"
-      . $config->{"swi:report"}->{"swi:xml"}->{"swi:name"};
-
-    my $fh = new FileHandle( $reportLocation . ".x", "w" ) or die ("Can not open output file '$reportLocation'!");
-
-    print $fh "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
-    print $fh "<swi:report>\n";
-    print $fh "\n";
-    print $fh "  <swi:info>\n";
-    print $fh "    <swi:version>1.0</swi:version>\n";
-    if (defined($ENV{USER}))
-    {
-        print $fh "    <swi:user>" . $ENV{USER} . "</swi:user>\n";
-    }
-    print $fh "    <swi:generator>SWI/MERGER</swi:generator>\n";
-    print $fh "  </swi:info>\n";
-    print $fh "\n";
-    
-    my $modulesCount = $#{ $config->{"swi:modules"}->{"swi:module"} } + 1;
-    my $filesCount = 0;
-    my $functionsCount = 0;
-
-    for ( my $i = 0 ; $i < $modulesCount ; $i++ )
-    {
-        my $modFh = new FileHandle( "$reportLocation.$i", "r" ) or die ("Can not open input file '$reportLocation.$i'!");
-        my @lines = <$modFh>;
-        $modFh->close();
-        for ( my $j = 3 ; $j < $#lines ; $j++ )
-        {
-            print $fh $lines[$j];
-            if ($lines[$j] =~ m/^[ ]*<swi:count>[ ]*$/)
-            {
-                if ($lines[$j+1] =~ m/^[ ]*<swi:files[ ]+swi:exact="([0-9]*)"[ ]*\/>[ ]*$/)
-                {
-                    my $numFilesInModule = $1;
-                    if ($lines[$j+2] =~ m/^[ ]*<swi:functions[ ]+swi:exact="([0-9]*)"[ ]*\/>[ ]*$/)
-                    {
-                        my $numFunctionsInModule = $1;
-                        $functionsCount += $numFunctionsInModule;
-                        $filesCount += $numFilesInModule;
-                    }
-                }
-            }
-        }
-    }
-
-    print $fh "  <swi:statistic>\n";
-    print $fh "    <swi:count>\n";
-    print $fh "      <swi:modules swi:exact=\"" . $modulesCount . "\" />\n";
-    print $fh "      <swi:files swi:exact=\"" . $filesCount . "\" />\n";
-    print $fh "      <swi:functions swi:exact=\"" . $functionsCount . "\" />\n";
-    print $fh "    </swi:count>\n";
-    print $fh "  </swi:statistic>\n";
-    print $fh "\n";
-
-    print $fh "</swi:report>\n";
-    
-    $fh->close();
-
-    return 0;
-}
-
-return 1;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 1710
lib/SWI/Processor.pm


+ 0 - 324
lib/String/CRC/Cksum.pm

@@ -1,324 +0,0 @@
-
-package String::CRC::Cksum;
-
-#use 5.6.1;
-use strict;
-use warnings;
-use Carp;
-
-require Exporter;
-our @ISA = qw(Exporter);
-our @EXPORT_OK = qw(cksum);
-our @EXPORT = qw();
-our $VERSION = '0.03';
-
-use fields qw(cksum size);
-
-my @crctab = (
-    0x00000000,
-    0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6,
-    0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac,
-    0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a,
-    0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58,
-    0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe,
-    0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4,
-    0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5,
-    0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07,
-    0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1,
-    0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b,
-    0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d,
-    0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f,
-    0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80,
-    0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a,
-    0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c,
-    0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e,
-    0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8,
-    0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2,
-    0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74,
-    0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21,
-    0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, 0x18197087,
-    0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d,
-    0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb,
-    0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, 0x89b8fd09,
-    0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf,
-    0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
-);
-
-
-sub new {
-    my $class = shift;
-    my String::CRC::Cksum $self = fields::new(ref $class || $class);
-    return $self->reset;
-}   # new
-
-
-sub reset {
-    my String::CRC::Cksum $self = shift;
-    $self->{cksum} = $self->{size} = 0;
-    return $self;
-}   # reset
-
-
-sub add {
-    use integer;
-    my String::CRC::Cksum $self = shift;
-    my $cksum = $self->{cksum};
-    my $size = $self->{size};
-
-    while(@_) {
-        my $n = length $_[0];
-
-        for(my $i = 0; $i < $n; ++$i) {
-            my $c = unpack 'C', substr $_[0], $i, 1;
-            $cksum = ($cksum << 8) ^ $crctab[($cksum >> 24) ^ $c];
-            ++$size;
-        }
-
-    }
-    continue { shift }
-
-    $self->{cksum} = $cksum;
-    $self->{size} = $size;
-
-    return $self;
-}   # add
-
-
-sub addfile {
-    my String::CRC::Cksum $self = shift;
-    my $stat;
-
-    local $_;
-    while(my $ifd = shift) {
-        $self->add($_) while $stat = read $ifd, $_, 4096;
-
-        if(! defined $stat) {
-            croak "error reading from filehandle: $!";
-        }
-    }
-
-    return $self;
-}   # addfile
-
-
-sub peek {
-    use integer;
-    my String::CRC::Cksum $self = shift;
-    my $cksum = $self->{cksum};
-    my $size = $self->{size};
-
-    # Extend with the length of the data
-    while($size != 0) {
-        my $c = $size & 0377;
-        $size >>= 8;
-        $cksum = ($cksum << 8) ^ $crctab[($cksum >> 24) ^ $c];
-    }
-    $cksum = ~ $cksum;
-
-    no integer;
-    my $crc = $cksum;
-    $crc += 4294967296 if $crc < 0;
-
-    return wantarray ? ($crc, $self->{size}) : $crc;
-
-}   # addfile
-
-
-sub result {
-    my String::CRC::Cksum $self = shift;
-    my ($cksum, $size) = $self->peek;
-    $self->reset;
-    return wantarray ? ($cksum, $size) : $cksum;
-}   # result
-
-
-sub cksum(@) {
-    my $sum = String::CRC::Cksum->new;
-
-    while(@_) {
-        if(ref $_[0])
-            { $sum->addfile($_[0]) }
-        else
-            { $sum->add($_[0]) }
-    }
-    continue { shift }
-
-    return $sum->result;
-}   # cksum
-
-1;
-
-__END__
-
-=head1 NAME
-
-String::CRC::Cksum - Perl extension for calculating checksums
-in a manner compatible with the POSIX cksum program.
-
-=head1 SYNOPSIS
-
-B<OO style>:
-  use String::CRC::Cksum;
-
-  $cksum = String::CRC::Cksum->new;
-  $cksum1 = $cksum->new;     # clone (clone is reset)
-
-  $cksum->add("string1");
-  $cksum->add("string2");
-  $cksum->add("string3", "string4", "string5", ...);
-  ...
-  ($cksum, $size) = $cksum->peek;
-  $cksum->add("string6", ...);
-  ...
-  ($cksum, $size) = $cksum->result;
-
-  $cksum1->addfile(\*file1);     # note: adding many files
-  $cksum1->addfile(\*file2);     # is probably a silly thing
-  $cksum1->addfile(\*file3);     # to do, but you *could*...
-  ...
-
-B<Functional style>:
-  use String::CRC::Cksum qw(cksum);
-
-  $cksum = cksum("string1", "string2", ...);
-
-  ($cksum, $size) = cksum("string1", "string2", ...);
-
-  $cksum = cksum(\*FILE);
-
-  ($cksum, $size) = cksum(\*FILE);
-
-=head1 DESCRIPTION
-
-The String::CRC::Cksum module calculates a 32 bit CRC,
-generating the same CRC value as the POSIX cksum program.
-If called in a list context, returns the length of the data
-object as well, which is useful for fully emulating
-the cksum program. The returned checksum will always be
-a non-negative integral number in the range 0..2^32-1.
-
-Despite its name, this module is able to compute the
-checksum of files as well as of strings.
-Just pass in a reference to a filehandle,
-or a reference to any object that can respond to
-a read() call and eventually return 0 at "end of file".
-
-Beware: consider proper use of binmode()
-if you are on a non-UNIX platform
-or processing files derived from other platforms.
-
-The object oriented interface can be used
-to progressively add data into the checksum
-before yielding the result.
-
-The functional interface is a convenient way
-to get a checksum of a single data item.
-
-None of the routines make local copies of passed-in strings
-so you can safely Cksum large strings safe in the knowledge
-that there won't be any memory issues.
-
-Passing in multiple files is acceptable,
-but perhaps of questionable value.
-However I don't want to hamper your creativity...
-
-=head1 FUNCTIONS                                                        
-
-The following functions are provided
-by the "String::CRC::Cksum" module.
-None of these functions are exported by default.
-
-=over 4
-
-=item B<new()>
-
-Creates a new String::CRC::Cksum object
-which is in a reset state, ready for action.
-If passed an existing String::CRC::Cksum object,
-it takes only the class -
-ie yields a fresh, reset object.
-
-=item B<reset()>
-
-Resets the Cksum object to the intialized state.
-An interesting phenomenom is,
-the CRC is not zero but 0xFFFFFFFF
-for a reset Cksum object.
-The returned size of a reset item will be zero.
-
-=item B<add("string", ...)>
-
-Progressively inject data into the Cksum object
-prior to requesting the final result.
-
-=item B<addfile(\*FILE, ...)>
-
-Progressively inject all (remaining) data from the file
-into the Cksum object prior to requesting the final result.
-The file handle passed in
-need only respond to the read() function to be usable,
-so feel free to pass in IO handles as needed.
-[hmmm - methinks I should have a test for that]
-
-=item B<peek($)>
-
-Yields the CRC checksum
-(and optionally the total size in list context)
-but does not reset the Cksum object.
-Repeated calls to peek() may be made
-and more data may be added.
-
-=item B<result($)>
-
-Yields the CRC checksum
-(and optionally the total size in list context)
-and then resets the Cksum object.
-
-=item B<cksum(@)>
-
-A convenient functional interface
-that may be passed a list of strings and filehandles.
-It will instantiate a Cksum object,
-apply the data and return the result
-in one swift, sweet operation.
-See how much I'm looking after you?
-
-NOTE: the filehandles must be passed as \*FD
-because I'm detecting a file handle using the ref() function.
-Therefore any blessed IO handle will also satisfy ref()
-and be interpreted as a file handle.
-
-=back
-
-=head2 EXPORT
-
-None by default.
-
-=head1 SEE ALSO
-
-manpages: cksum(1) or cksum(C) depending on your flavour of UNIX.
-
-http://www.opengroup.org/onlinepubs/007904975/utilities/cksum.html
-
-=head1 AUTHOR
-
-Andrew Hamm, E<lt>ahamm@cpan.orgE<gt>.
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright disclaimed 2003 by Andrew Hamm
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-Since I collected the algorithm
-from the Open Group web pages,
-they might have some issues but I doubt it.
-Let better legal minds than mine
-determine the issues if you need.
-[hopefully the CPAN and PAUSE administrators and/or testers
-will understand the issues better,
-and will replace this entire section
-with something reasonable - hint hint.]
-
-=cut

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 3284
lib/XML/Simple.pm


+ 0 - 646
lib/XML/Simple/FAQ.pod

@@ -1,646 +0,0 @@
-package XML::Simple::FAQ;
-1;
-
-__END__
-
-=head1 Frequently Asked Questions about XML::Simple
-
-
-=head1 Basics
-
-
-=head2 What is XML::Simple designed to be used for?
-
-XML::Simple is a Perl module that was originally developed as a tool for
-reading and writing configuration data in XML format.  You can use it for
-many other purposes that involve storing and retrieving structured data in
-XML.
-
-You might also find XML::Simple a good starting point for playing with XML
-from Perl.  It doesn't have a steep learning curve and if you outgrow its
-capabilities there are plenty of other Perl/XML modules to 'step up' to.
-
-
-=head2 Why store configuration data in XML anyway?
-
-The many advantages of using XML format for configuration data include:
-
-=over 4
-
-=item *
-
-Using existing XML parsing tools requires less development time, is easier
-and more robust than developing your own config file parsing code
-
-=item *
-
-XML can represent relationships between pieces of data, such as nesting of
-sections to arbitrary levels (not easily done with .INI files for example)
-
-=item *
-
-XML is basically just text, so you can easily edit a config file (easier than
-editing a Win32 registry)
-
-=item *
-
-XML provides standard solutions for handling character sets and encoding
-beyond basic ASCII (important for internationalization)
-
-=item *
-
-If it becomes necessary to change your configuration file format, there are
-many tools available for performing transformations on XML files
-
-=item *
-
-XML is an open standard (the world does not need more proprietary binary
-file formats)
-
-=item *
-
-Taking the extra step of developing a DTD allows the format of configuration
-files to be validated before your program reads them (not directly supported
-by XML::Simple)
-
-=item *
-
-Combining a DTD with a good XML editor can give you a GUI config editor for
-minimal coding effort
-
-=back
-
-
-=head2 What isn't XML::Simple good for?
-
-The main limitation of XML::Simple is that it does not work with 'mixed
-content' (see the next question).  If you consider your XML files contain
-marked up text rather than structured data, you should probably use another
-module.
-
-If you are working with very large XML files, XML::Simple's approach of
-representing the whole file in memory as a 'tree' data structure may not be
-suitable.
-
-
-=head2 What is mixed content?
-
-Consider this example XML:
-
-  <document>
-    <para>This is <em>mixed</em> content.</para>
-  </document>
-
-This is said to be mixed content, because the E<lt>paraE<gt> element contains
-both character data (text content) and nested elements.
-
-Here's some more XML:
-
-  <person>
-    <first_name>Joe</first_name>
-    <last_name>Bloggs</last_name>
-    <dob>25-April-1969</dob>
-  </person>
-
-This second example is not generally considered to be mixed content.  The
-E<lt>first_nameE<gt>, E<lt>last_nameE<gt> and E<lt>dobE<gt> elements contain
-only character data and the  E<lt>personE<gt> element contains only nested
-elements.  (Note: Strictly speaking, the whitespace between the nested
-elements is character data, but it is ignored by XML::Simple).
-
-
-=head2 Why doesn't XML::Simple handle mixed content?
-
-Because if it did, it would no longer be simple :-)
-
-Seriously though, there are plenty of excellent modules that allow you to
-work with mixed content in a variety of ways.  Handling mixed content
-correctly is not easy and by ignoring these issues, XML::Simple is able to
-present an API without a steep learning curve.
-
-
-=head2 Which Perl modules do handle mixed content?
-
-Every one of them except XML::Simple :-)
-
-If you're looking for a recommendation, I'd suggest you look at the Perl-XML
-FAQ at:
-
-  http://perl-xml.sourceforge.net/faq/
-
-
-=head1 Installation
-
-
-=head2 How do I install XML::Simple?
-
-If you're running ActiveState Perl, you've probably already got XML::Simple 
-(although you may want to upgrade to version 1.09 or better for SAX support).
-
-If you do need to install XML::Simple, you'll need to install an XML parser
-module first.  Install either XML::Parser (which you may have already) or
-XML::SAX.  If you install both, XML::SAX will be used by default.
-
-Once you have a parser installed ...
-
-On Unix systems, try:
-
-  perl -MCPAN -e 'install XML::Simple'
-
-If that doesn't work, download the latest distribution from
-ftp://ftp.cpan.org/pub/CPAN/authors/id/G/GR/GRANTM , unpack it and run these
-commands:
-
-  perl Makefile.PL
-  make
-  make test
-  make install
-
-On Win32, if you have a recent build of ActiveState Perl (618 or better) try
-this command:
-
-  ppm install XML::Simple
-
-If that doesn't work, you really only need the Simple.pm file, so extract it
-from the .tar.gz file (eg: using WinZIP) and save it in the \site\lib\XML 
-directory under your Perl installation (typically C:\Perl).
-
-
-=head2 I'm trying to install XML::Simple and 'make test' fails
-
-Is the directory where you've unpacked XML::Simple mounted from a file server
-using NFS, SMB or some other network file sharing?  If so, that may cause
-errors in the the following test scripts:
-
-  3_Storable.t
-  4_MemShare.t
-  5_MemCopy.t
-
-The test suite is designed to exercise the boundary conditions of all
-XML::Simple's functionality and these three scripts exercise the caching
-functions.  If XML::Simple is asked to parse a file for which it has a cached
-copy of a previous parse, then it compares the timestamp on the XML file with
-the timestamp on the cached copy.  If the cached copy is *newer* then it will
-be used.  If the cached copy is older or the same age then the file is
-re-parsed.  The test scripts will get confused by networked filesystems if
-the workstation and server system clocks are not synchronised (to the
-second).
-
-If you get an error in one of these three test scripts but you don't plan to
-use the caching options (they're not enabled by default), then go right ahead
-and run 'make install'.  If you do plan to use caching, then try unpacking
-the distribution on local disk and doing the build/test there.
-
-It's probably not a good idea to use the caching options with networked
-filesystems in production.  If the file server's clock is ahead of the local
-clock, XML::Simple will re-parse files when it could have used the cached
-copy.  However if the local clock is ahead of the file server clock and a
-file is changed immediately after it is cached, the old cached copy will be
-used.
-
-Is one of the three test scripts (above) failing but you're not running on
-a network filesystem?  Are you running Win32?  If so, you may be seeing a bug
-in Win32 where writes to a file do not affect its modfication timestamp.
-
-If none of these scenarios match your situation, please confirm you're
-running the latest version of XML::Simple and then email the output of
-'make test' to me at grantm@cpan.org
-
-=head2 Why is XML::Simple so slow?
-
-If you find that XML::Simple is very slow reading XML, the most likely reason
-is that you have XML::SAX installed but no additional SAX parser module.  The
-XML::SAX distribution includes an XML parser written entirely in Perl.  This is
-very portable but not very fast.  For better performance install either
-XML::SAX::Expat or XML::LibXML.
-
-
-=head1 Usage
-
-=head2 How do I use XML::Simple?
-
-If you had an XML document called /etc/appconfig/foo.xml you could 'slurp' it
-into a simple data structure (typically a hashref) with these lines of code:
-
-  use XML::Simple;
-
-  my $config = XMLin('/etc/appconfig/foo.xml');
-
-The XMLin() function accepts options after the filename.
-
-
-=head2 There are so many options, which ones do I really need to know about?
-
-Although you can get by without using any options, you shouldn't even
-consider using XML::Simple in production until you know what these two
-options do:
-
-=over 4
-
-=item *
-
-forcearray
-
-=item *
-
-keyattr
-
-=back
-
-The reason you really need to read about them is because the default values
-for these options will trip you up if you don't.  Although everyone agrees
-that these defaults are not ideal, there is not wide agreement on what they
-should be changed to.  The answer therefore is to read about them (see below)
-and select values which are right for you.
-
-
-=head2 What is the forcearray option all about?
-
-Consider this XML in a file called ./person.xml:
-
-  <person>
-    <first_name>Joe</first_name>
-    <last_name>Bloggs</last_name>
-    <hobbie>bungy jumping</hobbie>
-    <hobbie>sky diving</hobbie>
-    <hobbie>knitting</hobbie>
-  </person>
-
-You could read it in with this line:
-
-  my $person = XMLin('./person.xml');
-
-Which would give you a data structure like this:
-
-  $person = {
-    'first_name' => 'Joe',
-    'last_name'  => 'Bloggs',
-    'hobbie'     => [ 'bungy jumping', 'sky diving', 'knitting' ]
-  };
-
-The E<lt>first_nameE<gt> and E<lt>last_nameE<gt> elements are represented as
-simple scalar values which you could refer to like this:
-
-  print "$person->{first_name} $person->{last_name}\n";
-
-The E<lt>hobbieE<gt> elements are represented as an array - since there is
-more than one.  You could refer to the first one like this:
-
-  print $person->{hobbie}->[0], "\n";
-
-Or the whole lot like this:
-
-  print join(', ', @{$person->{hobbie}} ), "\n";
-
-The catch is, that these last two lines of code will only work for people
-who have more than one hobbie.  If there is only one E<lt>hobbieE<gt>
-element, it will be represented as a simple scalar (just like
-E<lt>first_nameE<gt> and E<lt>last_nameE<gt>).  Which might lead you to write
-code like this:
-
-  if(ref($person->{hobbie})) {
-    print join(', ', @{$person->{hobbie}} ), "\n";
-  }
-  else {
-    print $person->{hobbie}, "\n";
-  }
-
-Don't do that.
-
-One alternative approach is to set the forcearray option to a true value:
-
-  my $person = XMLin('./person.xml', forcearray => 1);
-
-Which will give you a data structure like this:
-
-  $person = {
-    'first_name' => [ 'Joe' ],
-    'last_name'  => [ 'Bloggs' ],
-    'hobbie'     => [ 'bungy jumping', 'sky diving', 'knitting' ]
-  };
-
-Then you can use this line to refer to all the list of hobbies even if there
-was only one:
-
-  print join(', ', @{$person->{hobbie}} ), "\n";
-
-The downside of this approach is that the E<lt>first_nameE<gt> and
-E<lt>last_nameE<gt> elements will also always be represented as arrays even
-though there will never be more than one:
-
-  print "$person->{first_name}->[0] $person->{last_name}->[0]\n";
-
-This might be OK if you change the XML to use attributes for things that
-will always be singular and nested elements for things that may be plural:
-
-  <person first_name="Jane" last_name="Bloggs">
-    <hobbie>motorcycle maintenance</hobbie>
-  </person>
-
-On the other hand, if you prefer not to use attributes, then you could
-specify that any E<lt>hobbieE<gt> elements should always be represented as
-arrays and all other nested elements should be simple scalar values unless
-there is more than one:
-
-  my $person = XMLin('./person.xml', forcearray => [ 'hobbie' ]);
-
-The forcearray option accepts a list of element names which should always
-be forced to an array representation:
-
-  forcearray => [ qw(hobbie qualification childs_name) ]
-
-See the XML::Simple manual page for more information.
-
-
-=head2 What is the keyattr option all about?
-
-Consider this sample XML:
-
-  <catalog>
-    <part partnum="1842334" desc="High pressure flange" price="24.50" />
-    <part partnum="9344675" desc="Threaded gasket"      price="9.25" />
-    <part partnum="5634896" desc="Low voltage washer"   price="12.00" />
-  </catalog>
-
-You could slurp it in with this code:
-
-  my $catalog = XMLin('./catalog.xml');
-
-Which would return a data structure like this:
-
-  $catalog = {
-      'part' => [
-          {
-            'partnum' => '1842334',
-            'desc'    => 'High pressure flange',
-            'price'   => '24.50'
-          },
-          {
-            'partnum' => '9344675',
-            'desc'    => 'Threaded gasket',
-            'price'   => '9.25'
-          },
-          {
-            'partnum' => '5634896',
-            'desc'    => 'Low voltage washer',
-            'price'   => '12.00'
-          }
-      ]
-  };
-
-Then you could access the description of the first part in the catalog
-with this code:
-
-  print $catalog->{part}->[0]->{desc}, "\n";
-
-However, if you wanted to access the description of the part with the
-part number of "9344675" then you'd have to code a loop like this:
-
-  foreach my $part (@{$catalog->{part}}) {
-    if($part->{partnum} eq '9344675') {
-      print $part->{desc}, "\n";
-      last;
-    }
-  }
-
-The knowledge that each E<lt>partE<gt> element has a unique partnum attribute
-allows you to eliminate this search.  You can pass this knowledge on to
-XML::Simple like this:
-
-  my $catalog = XMLin($xml, keyattr => ['partnum']);
-
-Which will return a data structure like this:
-
-  $catalog = {
-    'part' => {
-      '5634896' => { 'desc' => 'Low voltage washer',   'price' => '12.00' },
-      '1842334' => { 'desc' => 'High pressure flange', 'price' => '24.50' },
-      '9344675' => { 'desc' => 'Threaded gasket',      'price' => '9.25'  }
-    }
-  };
-
-XML::Simple has been able to transform $catalog->{part} from an arrayref to
-a hashref (keyed on partnum).  This transformation is called 'array folding'.
-
-Through the use of array folding, you can now index directly to the
-description of the part you want:
-
-  print $catalog->{part}->{9344675}->{desc}, "\n";
-
-The 'keyattr' option also enables array folding when the unique key is in a
-nested element rather than an attribute.  eg:
-
-  <catalog>
-    <part>
-      <partnum>1842334</partnum>
-      <desc>High pressure flange</desc>
-      <price>24.50</price>
-    </part>
-    <part>
-      <partnum>9344675</partnum>
-      <desc>Threaded gasket</desc>
-      <price>9.25</price>
-    </part>
-    <part>
-      <partnum>5634896</partnum>
-      <desc>Low voltage washer</desc>
-      <price>12.00</price>
-    </part>
-  </catalog>
-
-See the XML::Simple manual page for more information.
-
-
-=head2 So what's the catch with 'keyattr'?
-
-One thing to watch out for is that you might get array folding even if you
-don't supply the keyattr option.  The default value for this option is:
-
-  [ 'name', 'key', 'id']
-
-Which means if your XML elements have a 'name', 'key' or 'id' attribute (or
-nested element) then they may get folded on those values.  This means that
-you can take advantage of array folding simply through careful choice of
-attribute names.  On the hand, if you really don't want array folding at all,
-you'll need to set 'key attr to an empty list:
-
-  my $ref = XMLin($xml, keyattr => []);
-
-A second 'gotcha' is that array folding only works on arrays.  That might
-seem obvious, but if there's only one record in your XML and you didn't set
-the 'forcearray' option then it won't be represented as an array and
-consequently won't get folded into a hash.  The moral is that if you're
-using array folding, you should always turn on the forcearray option.
-
-You probably want to be as specific as you can be too.  For instance, the
-safest way to parse the E<lt>catalogE<gt> example above would be:
-
-  my $catalog = XMLin($xml, keyattr => { part => 'partnum'},
-                            forcearray => ['part']);
-
-By using the hashref for keyattr, you can specify that only E<lt>partE<gt>
-elements should be folded on the 'partnum' attribute (and that the
-E<lt>partE<gt> elements should not be folded on any other attribute).
-
-By supplying a list of element names for forcearray, you're ensuring that
-folding will work even if there's only one E<lt>partE<gt>.  You're also
-ensuring that if the 'partnum' unique key is supplied in a nested element
-then that element won't get forced to an array too.
-
-
-=head2 How do I know what my data structure should look like?
-
-The rules are fairly straightforward:
-
-=over 4
-
-=item *
-
-each element gets represented as a hash
-
-=item *
-
-unless it contains only text, in which case it'll be a simple scalar value
-
-=item *
-
-or unless there's more than one element with the same name, in which case
-they'll be represented as an array
-
-=item *
-
-unless you've got array folding enabled, in which case they'll be folded into
-a hash
-
-=item *
-
-empty elements (no text contents B<and> no attributes) will either be
-represented as an empty hash, an empty string or undef - depending on the value
-of the 'suppressempty' option.
-
-=back
-
-If you're in any doubt, use Data::Dumper, eg:
-
-  use XML::Simple;
-  use Data::Dumper;
-  
-  my $ref = XMLin($xml);
-
-  print Dumper($ref);
-
-
-=head2 I'm getting 'Use of uninitialized value' warnings
-
-You're probably trying to index into a non-existant hash key - try
-Data::Dumper.
-
-
-=head2 I'm getting a 'Not an ARRAY reference' error
-
-Something that you expect to be an array is not.  The two most likely causes
-are that you forgot to use 'forcearray' or that the array got folded into a
-hash - try Data::Dumper.
-
-
-=head2 I'm getting a 'No such array field' error
-
-Something that you expect to be a hash is actually an array.  Perhaps array
-folding failed because one element was missing the key attribute - try
-Data::Dumper.
-
-
-=head2 I'm getting an 'Out of memory' error
-
-Something in the data structure is not as you expect and Perl may be trying
-unsuccessfully to autovivify things - try Data::Dumper.
-
-If you're already using Data::Dumper, try calling Dumper() immediately after
-XMLin() - ie: before you attempt to access anything in the data structure.
-
-
-=head2 My element order is getting jumbled up
-
-If you read an XML file with XMLin() and then write it back out with
-XMLout(), the order of the elements will likely be different.  (However, if
-you read the file back in with XMLin() you'll get the same Perl data
-structure).
-
-The reordering happens because XML::Simple uses hashrefs to store your data
-and Perl hashes do not really have any order.
-
-It is possible that a future version of XML::Simple will use Tie::IxHash
-to store the data in hashrefs which do retain the order.  However this will
-not fix all cases of element order being lost.
-
-If your application really is sensitive to element order, don't use
-XML::Simple (and don't put order-sensitive values in attributes).
-
-
-=head2 XML::Simple turns nested elements into attributes
-
-If you read an XML file with XMLin() and then write it back out with
-XMLout(), some data which was originally stored in nested elements may end up
-in attributes.  (However, if you read the file back in with XMLin() you'll
-get the same Perl data structure).
-
-There are a number of ways you might handle this:
-
-=over 4
-
-=item *
-
-use the 'forcearray' option with XMLin()
-
-=item *
-
-use the 'noattr' option with XMLout()
-
-=item *
-
-live with it
-
-=item *
-
-don't use XML::Simple
-
-=back
-
-
-=head2 Why does XMLout() insert E<lt>nameE<gt> elements (or attributes)?
-
-Try setting keyattr => [].
-
-When you call XMLin() to read XML, the 'keyattr' option controls whether arrays
-get 'folded' into hashes.  Similarly, when you call XMLout(), the 'keyattr'
-option controls whether hashes get 'unfolded' into arrays.  As described above,
-'keyattr' is enabled by default.
-
-=head2 Why are empty elements represented as empty hashes?
-
-An element is always represented as a hash unless it contains only text, in
-which case it is represented as a scalar string.
-
-If you would prefer empty elements to be represented as empty strings or the
-undefined value, set the 'suppressempty' option to '' or undef respectively.
-
-=head2 Why is ParserOpts deprecated?
-
-The C<ParserOpts> option is a remnant of the time when XML::Simple only worked
-with the XML::Parser API.  Its value is completely ignored if you're using a
-SAX parser, so writing code which relied on it would bar you from taking
-advantage of SAX.
-
-Even if you are using XML::Parser, it is seldom necessary to pass options to
-the parser object.  A number of people have written to say they use this option
-to set XML::Parser's C<ProtocolEncoding> option.  Don't do that, it's wrong,
-Wrong, WRONG!  Fix the XML document so that it's well-formed and you won't have
-a problem.
-
-Having said all of that, as long as XML::Simple continues to support the
-XML::Parser API, this option will not be removed.  There are currently no plans
-to remove support for the XML::Parser API.
-
-=cut
-
-