#!/usr/bin/perl use strict; use warnings; my $input = $ARGV[0]; my ($service, $state) = $input =~ /Service:(.*)State:(.*)/s; my $company = substr $service, 0, 6; print <