Matrix Science header

config_license.pl

Read in the mascot.license file.

#!/usr/local/bin/perl
##############################################################################
# file: config_license.pl                                                    #
# 'msparser' toolkit example code                                            #
##############################################################################
# COPYRIGHT NOTICE                                                           #
# Copyright 1998-2010 Matrix Science Limited  All Rights Reserved.           #
#                                                                            #
##############################################################################
#     $Source: /vol/cvsroot/parser/examples/test_perl/config_license.pl,v $ #
#     $Author: villek $                                                      #
#       $Date: 2010/08/31 08:48:07 $                                         #
#   $Revision: 1.4 $                                                         #
# $NoKeywords::                                                            $ #
##############################################################################
use strict;
##############################################################################

use msparser;

if (!defined($ARGV[0])) {
    print "Location of 'mascot.license' file has to be specified as a parameter\n";
    exit 1;
}

my $file = new msparser::ms_license($ARGV[0]);

if (!$file->isValid) {
    print "There are errors. Cannot continue. The last error description:\n";
    print $file->getLastErrorString(), "\n";
    exit 1;
}

if ($file->isLicenseValid) {
    print "Mascot license is still valid. Other information:\n";
    print $file->getLicenseString(), "\n";
} else {
    print "Mascot license has either expired or been corrupted\n";
}


=pod

Running the program as 

perl -I../bin config_license.pl mascot.license

will give, without a Mascot license file:


There are errors. Cannot continue. The last error description:
Missing license file: mascot.license.

=cut

Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:50