[system] / trunk / webwork / system / scripts / convert_1_CAPA_aux_2_PG.pl Repository:
ViewVC logotype

View of /trunk/webwork/system/scripts/convert_1_CAPA_aux_2_PG.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 70 - (download) (as text) (annotate)
Mon Jun 25 18:20:05 2001 UTC (18 years, 5 months ago) by sam
File size: 983 byte(s)
Removed unneeded scripts (as per discussion with gage, apizer). Added
BEGIN-block method for library inclusion to command-line scripts.

    1 #!/usr/local/bin/webwork-perl
    2 
    3 BEGIN {
    4   my $useLibDir = '.';
    5   if    ($0 =~ m|^(/.*)/|)  { $useLibDir = $1; }
    6   elsif ($0 =~ m|^(\..*)/|) { $useLibDir = $1; }
    7   elsif ($0 =~ m|^(.+)/|)   { $useLibDir = "./$1"; }
    8   unshift @INC, $useLibDir;
    9 }
   10 
   11 use webworkInit; # WeBWorKInitLine
   12 use capa2PG;
   13 
   14 
   15 # begin Timing code
   16 use Benchmark;
   17 my $beginTime = new Benchmark;
   18 # end Timing code
   19 
   20 
   21 
   22  my $ARGV;
   23  my @file_lines;
   24 unless ( @ARGV) {
   25   print "Useage   convert_1_CAPA_aux_2_PG.pl  input_file   >output.file\n\n";
   26   exit;
   27 }
   28  while ($ARGV = shift) {
   29      print "#   READING FROM $ARGV\n\n";
   30 
   31     open(ARGV, "<$ARGV") || die " Can't read file $ARGV ";
   32     @file_lines = <ARGV>;
   33     close(ARGV);
   34     print parse_CAPA_aux_file(\@file_lines);
   35  }
   36 
   37 ## begin Timing code
   38 my $endTime = new Benchmark;
   39 print "\n#################################################\n## Processing time = ", timestr( timediff($endTime,$beginTime) ),
   40       "\n#################################################\n";
   41 ## end Timing code

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9