in reply to Perl IF Issue

Put print ">$HOSTNME< >$SRVCHX<"; right before the if statement. It should print without a line break, and the arrows should be right next to the expected text.

First thing to do in these situations is verify that your data is exactly what you expect.

Replies are listed 'Best First'.
Re^2: Perl IF Issue
by intoperl (Acolyte) on Aug 20, 2015 at 16:00 UTC

    Thanks Stevieb for your suggestion. Here how it looks like after i did what you told (when i keep the both the argurments same):

    >tantra.zdr.moksha.com < >tantra.zdr.moksha.com<

      Do a chomp $HOSTNME; prior to the if statement. That variable has an attached newline (\n) at the end if it.

      Update: See perldoc -f chomp to understand the purpose of chomp.

      -stevieb