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: parser/examples/test_perl/config_license.pl $ #
#     $Author: villek@matrixscience.com $                                                      #
#       $Date: 2018-07-30 16:23:53 +0100 $                                         #
#   $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_2_8_1-0-gea32989045 $                                                         #
# $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 © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:29