#!/usr/bin/perl use strict; use warnings; my ($f1, $f2, $f3, $f4, $f5, $f6, $f7) = ("") x 7; #$f3="C"; my $xout = "$system|$f2|$f3|$f4|$f5|$f6|$f7|\n"; if ( defined $f3 && $f3 ne '' ) { print $xout; print "\$f3 is defined \n"; } else { my $f5 = "N"; my $f7 = "G"; print $xout; print "the 7th and 8th blocks should have values \n"; } #### host1||C||||| host2||C||||| host3||||N||G| host4||C||||| host5||||N||G|