1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use strict;
use POSIX;
use File::Copy;
my $importConfigurationPath = substr($0,0,2 ) . "/copra-server/common/scripts/importConfiguration.pl";
require "$importConfigurationPath";
#exit falls aufruf mit != 3 argumenten
if ($#ARGV + 1 != 3){
print "invalid amount of args, syntax has to be distributeJobs.pl [BPS_CONFIG_FILE] [JobsToDistributeFolder] [job-prefix]]\n";
exit;
}
(my $config_filename, my $jobsToDistributeFolder, my $jobPrefix) = @ARGV;
my $logfolder = $configValue{logfolder};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
my $importConfigurationFile = substr($0,0,2) . "/copra-server/common/configuration/configuration.properties";
our %configValue;
print "\nstarting importconfiguration.pl\n";
open(FILE,$importConfigurationFile);
while(defined(my $line = <FILE>)) {
if ($line =~ m/.*=.*/g){
chomp($line);
my $key = substr($line,0,index($line,"="));
my $value = substr($line,index($line,"=")+1,length($line));
#print "key is: $key -----> value is: $value\n";
$configValue{"$key"}="$value";
}
}
close(FILE);
while ((my $currentKey,my $currentValue) = each %configValue){
print "key, value pair is ($currentKey,$currentValue)\n";
}
print "-------import finished -----------------------\n";
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/perl use strict; use warnings; use vars qw/$MALM/; require "lib.pl"; print "MALM ist ", $MALM;
Quotelokale Variable mit our deklariert