in reply to Perl IF Issue
Try comparing them character by character:
die "Different length" if length $HOSTNME != length $SRVCHX; for my $pos (0 .. length($HOSTNME) - 1) { warn warn "$HOSTNME\n", " " x $pos, "| $pos\n$SRVCHX\n" if substr($HOSTNME, $pos, 1) ne substr($SRVCHX, $pos, 1); }
Also, do you use strict? Just to make sure there's no typo in the variables' names.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl IF Issue
by intoperl (Acolyte) on Aug 20, 2015 at 16:04 UTC |