OK, I did some googling for "Perl remove newline" and came across a technique that worked where chomp failed. Instead of "chomp($hostname)", I used this regex:
$hostname =~ s/\R//g;
Now when I run my code, the regex match and the print output all works as expected. I hope this can help someone else in the future!!
ImJustAFriend
In reply to Re: Unexpected Behavior - Variables and Regex
by ImJustAFriend
in thread Unexpected Behavior - Variables and Regex
by ImJustAFriend
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |