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_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
# $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