Help for this page

Select Code to Download


  1. or download this
    use strict;
    
    ...
    use Digest::MD5;
    use Time::HiRes;
    
  2. or download this
    # prepare thread pool
    my $pool = Thread::Pool::Simple->new(
    ...
                     do => [\&parse_artifact]
                   ) || print "couldn't create thread pool: $!\n";;
    
  3. or download this
    # load all format files
    eval
    ...
                    require  $format_dir . '/' . $formats{$_}->{'file'};
            }
    };
    
  4. or download this
    # now we need to recursively go through every file and directory in th
    +at we got provided as an input and verify if we can parse it (and the
    +n parse the file)
    parse_dir( $dir );
    
  5. or download this
    # wait for thread pool to empty
    $pool->join();
    
  6. or download this
    # we have the artifact here, it's verified so we just need to parse it
    sub parse_artifact()
    ...
            # load the log file (prepare, action provided here depends on 
    +the format in question)
            print "parse_artifact fired; format passed is: $format->{'name
    +'}; file passed is $file\n";