use v5.20.0; my @stoppedStandardServices = ( 'OP OPC Client', 'OP Calculation Server', 'OP Data Server', 'OP Configuration Server', 'OP Log Server', 'OP Time Server', 'ONC RPC PortMapper'); my $supported = '4.0.0,4.0.1,4.1.0,4.1.1,4.1.2'; $supported =~ /.(?{say '>>> In the regex'})/ if @ARGV; "4.1.2" =~ //; say "Start Basic Standard Services:"; startStandardServices( 'Config'); say "Start Remaining Standard Services:"; startStandardServices(); say "Installation completed"; sub startStandardServices { my $last = shift; my $name; while (@stoppedStandardServices) { $name = pop @stoppedStandardServices; say ' Starting $name=\'', $name, '\' $last=', defined $last ? "'$last'" : 'undef', ' ($name=~/$last/i)=', ($name =~ /$last/i) ? 1 : 0; last if $name =~ /$last/i; } }