I'm attempting to use scandeps (and eventually pp) with some code that requires File::ChangeNotify. File::ChangeNotify has a dependency of Moose which means whenever scandeps is run with the "-c" flag Moose is changing sub names, which is causing scandeps to fail. I have not tried the "-x" flag, as my use of File::ChangeNotify effectively becomes an infinite loop, causing "-x" to misbehave. I'm running on the Win32 platform, and self compiled perl rather than using Active or Strawberry. Output is as follows :
Scandeps outputPerl configurationPS C:\Users\dtrzcinski\workspace\Clear Pre Processing> scandeps -c '.\ +XML Classifier JDE.pl' # Use of runtime loader module Module::Implementation detected. Resul +ts of static scanning may be incomplete. # Use of runtime loader module Module::Runtime detected. Results of s +tatic scanning may be incomplete. (set by Moose): No such file or directory at C:/perl/site/lib/Module/S +canDeps/DataFeed.pm line 26. CHECK failed--call queue aborted. SYSTEM ERROR in compiling .\XML Classifier JDE.pl: 512 at C:/perl/site +/lib/Module/ScanDeps.pm line 1348.
The actual code I'm trying to run scandeps on :PS C:\Users\dtrzcinski\workspace\Clear Pre Processing> perl -V Summary of my perl5 (revision 5 version 20 subversion 1) configuration +: Platform: osname=MSWin32, osvers=6.1, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -DWIN32 -D +_CONSOLE -DNO_STRICT -DPERL_TEXTMODE_SCRIPTS -DPE RL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME +_T', optimize='-O1 -MD -Zi -DNDEBUG', cppflags='-DWIN32' ccversion='18.00.31101', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -l +ibpath:"c:\perl\lib\CORE" -machine:x86' libpth=\lib libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib +comdlg32.lib advapi32.lib shell32.lib ole32.lib ol eaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib versio +n.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt. lib perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.l +ib comdlg32.lib advapi32.lib shell32.lib ole32.li b oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib ve +rsion.lib odbc32.lib odbccp32.lib comctl32.lib msv crt.lib libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl520.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf -libpath:"c:\perl\lib\CORE" -machine:x86 ' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV USE_ITHREADS USE_LARGE_FILE +S USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under MSWin32 Compiled at Jan 14 2015 14:56:04 @INC: C:/perl/site/lib/MSWin32-x86-multi-thread C:/perl/site/lib C:/perl/lib .
#!/usr/bin/perl use Modern::Perl; no warnings; no if $] >= 5.017011, warnings => 'experimental::smartmatch'; # do singleton check and possible bailout as early as possible. use Fcntl qw(:flock); my $lockfile = 'E:\\FlowData\\PreProcess\\classifier.lock'; sub BailOut { print "$0 is already running. Exiting.\n"; exit(1); } open( my $fhpid, '>>', $lockfile ) or die "error: open '$lockfile': $! +"; flock( $fhpid, LOCK_EX | LOCK_NB ) or BailOut(); use strict; no warnings; use AI::Categorizer; use AI::Categorizer::Collection::Files; use Algorithm::NaiveBayes::Model::Frequency; use File::Spec; use File::Copy; use File::ChangeNotify; our $cat_file = 'E:\\FlowData\\PreProcess\\cats.txt'; our $path = 'E:\\FlowData\\ALL'; my $watcher = File::ChangeNotify->instantiate_watcher( directories => [$path], filter => qr/\.(?:xml)$/, ); use AI::Categorizer::Learner::NaiveBayes; our %files; our $nb = AI::Categorizer::Learner::NaiveBayes->restore_state('E:\\Flo +wData\\PreProcess\\state'); print "Begining to watch $path for changes.\n"; while ( my @events = $watcher->wait_for_events() ) { print "New files have been detected.\n"; open my $out_fh, '>', $cat_file; opendir( DIR, $path ) or die $!; while ( my $file = readdir(DIR) ) { # Use a regular expression to ignore files beginning w +ith a period next if ( $file =~ m/^\./ ); print {$out_fh} "$file \n"; } closedir(DIR); close $out_fh; my $c = new AI::Categorizer::Collection::Files( path => $path, + category_file => $cat_file ); while ( my $document = $c->next ) { my $hypothesis = $nb->categorize($document); print "Classified ", $hypothesis->document_name(); print " as ", $hypothesis->best_category, "\n"; my $original = $path . "\\" . $hypothesis->document_ +name(); my $classified = 'E:\\FlowData\\PreProcess\\'.$hypothe +sis->best_category().'\\'.$hypothesis->document_na me(); if ( $original =~ /^(.*)$/ ) { $original = $1; # $data now untainted } else { die "Bad data in $original"; # log this som +ewhere } if ( $classified =~ /^(.*)$/ ) { $classified = $1; # $data now un +tainted } else { die "Bad data in $classified"; # log this s +omewhere } move( $original, $classified ); } }
In reply to Module::ScanDeps interaction with Moose:: by xlr82xs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |