I have the following code that is not working. The problem seems to be with what I am redefining the default record separator to. I know I have done this before in a while loop to change the scope of what a record is defined as. Any help is appriciated.
If at first you don't succeed, don't try skydiving.
Code:
use strict;
use warnings;
my $prefix = shift @ARGV;
my $cpu = shift @ARGV;
my $sched_name = shift @ARGV;
my $job_name = shift @ARGV;
open (CFG, "/home/mt71124/scripts/maestro_inst.txt") or die ("Error opening config file: $1");
$/ = &;
while (<CFG>) {
next if /^\#/;
next unless ($_ =~ /^$prefix\s+$cpu\s+$sched_name\s+$job_name\s+(\w+)/);
print;
exit;
}
print "Contact the application oncall for this prefix to remediate./n The workstation is $cpu the schedule is $sched_name the job is $job_name\n";
If at first you don't succeed, don't try skydiving.