--- processmail/collection.pl 2008/03/24 16:01:47 3.1 +++ processmail/collection.pl 2013/10/11 15:39:35 3.2 @@ -1,20 +1,23 @@ -#!/usr/local/bin/perl +#!/usr/bin/perl # -#$Id: collection.pl,v 3.1 2008/03/24 16:01:47 boris Exp $ +#$Id: collection.pl,v 3.2 2013/10/11 15:39:35 boris Exp $ # # óÏÂÒÁÎÉÅ ÓÏÞÉÎÅÎÉÊ # - use Getopt::Std; + +use Getopt::Std; $usage = -"Usage: collection.pl [-d] [-t table_file] [-o results] \n"; +"Usage: collection.pl [-d] [-s|-m] [-t table_file] [-o results] \n"; require 'parameters.pl'; require 'subroutines.pl'; -die $usage unless getopts('t:o:d'); +die $usage unless getopts('t:o:dsm'); $DEBUG=$opt_d; +$SHORT=$opt_s; +$MEDIUM=$opt_m; # îÁÈÏÄÉÍ ÍÁËÓÉÍÁÌØÎÙÊ ×ÏÐÒÏÓ $MAXQUEST=1; @@ -61,12 +64,19 @@ if ($opt_o) for ($i=1;$i<=$MAXQUEST;$i++) { print "\n÷ïðòïó $i:\n"; - print "\núáóþéôáîï:\n"; - anondump(\%teams,\@answers,$i,'+'); - print "\nîå úáóþéôáîï:\n"; - anondump(\%teams,\@answers,$i,'-'); - print "\nîå ñóîï:\n"; - anondump(\%teams,\@answers,$i,'?'); + if ( ! $SHORT || countanswers(\%teams,\@answers,$i,'+') ) { + print "\núáóþéôáîï:\n"; + anondump(\%teams,\@answers,$i,'+'); + } + if ( ! $SHORT || countanswers(\%teams,\@answers,$i,'+') ) { + print "\nîå úáóþéôáîï:\n"; + anondump(\%teams,\@answers,$i,'-'); + } + if ( ! ($SHORT || $MEDIUM) || countanswers(\%teams,\@answers,$i,'?') ) { + print "\nîå ñóîï:\n"; + anondump(\%teams,\@answers,$i,'?'); + } + print "\n"; # Added by LG for better readability } print "***\n";