in reply to Re: if elsif elsif prints all three.
in thread if elsif elsif prints all three.

Yes if =~ m/bestcollect/ That means the line is ok. So, leave it alone. if there is no $line. Then insert the here documnet $bgs before 'syslogd' Thanks