in reply to Re: Print unless behaving strangely
in thread Print unless behaving strangely

this or any other "invisible" problem could also be visualized with Data::Dump

use Data::Dump; $_ = qq{PID: \0, VID: 255, SN: AGM163923J5}; dd $_;

"PID: \0, VID: 255, SN: AGM163923J5"

Cheers Rolf

( addicted to the Perl Programming Language)

Replies are listed 'Best First'.
Re^3: Print unless behaving strangely
by chrisayres11 (Novice) on Jun 03, 2014 at 09:26 UTC

    Thanks for all the replies, I will try to answer them all

    Yes I did mean "$_ contains the value 'PID: , VID: 255, SN: AGM163923J5". So this wasn't a section of the perl code. I am reading a file and it is at this line that strangeness happens.

    Yes I am using Strict and Warnings

    I have put the output direct from the Cisco CLI through a Hex translator and there doesn't seem to be any hidden/null characters

    PID: , VID:

    0x500x490x440x3a0x200x2c0x200x560x490x440x3a

    but the output from the file perl is holding the string in does have extra characters.

    0x500x490x440x3a 0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x7f0x2c 0x560x490x440x3a

    Thanks for all your help