AI-MicroStructure

 view release on metacpan or  search on metacpan

bin/micro  view on Meta::CPAN

#!/usr/bin/perl -X

use strict;
use warnings;
use Digest::MD5 qw(md5_hex);
use AI::MicroStructure::Util;
use Getopt::Long;
use AI::MicroStructure;
use Data::Printer;
use Data::Dumper;
use JSON::XS;
use Try::Tiny;
use Cache::Memcached::Fast;
my %conf = ( );
our $keys = {};
GetOptions( \%conf, "whitespace|ws!", "version","structures", "help", "remote","new",
                    "init", "export", "import",
                    "check", "category=s", "sources" ,"drop");

our ($new, $write,$drop,$all,$verbose) =(0,0,0,0,0);
our $kkey = sprintf "%s",join("_",@ARGV);
our $argkey = md5_hex($kkey);
our $memd  = "";
sub check {

}


sub init {

  $memd = new Cache::Memcached::Fast({
     servers => [ { address => 'localhost:11211', weight => 2.5 }],
     namespace => 'my:',
     connect_timeout => 0.2,
     io_timeout => 0.1,
     close_on_error => 1,
     compress_threshold => 100_000,
     compress_ratio => 0.9,
     max_failures => 1,
     max_size => 512 * 1024,
  });

  if(!$#ARGV){
    push @ARGV,"any";
   }



if($kkey =~ /debug/){
  my $NORMAL=`tput sgr0`;
  my $REVERSE=`tput smso`;
  print "$REVERSE $_ $NORMAL " for @ARGV;
  print "\n";
}else{
}

   if(defined(my $ret = $memd->get($argkey)) && ($kkey !~ m/(any|structures)/i) &&  @ARGV){

   print "$ret\n";

   exit;
   #die($ret);
  }else{

  }


}
init();
if( grep{/\ball\b/} @ARGV ){ $all = 1; cleanArgs("all");  };


 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.543 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )