himanshu.padmanabhi has asked for the wisdom of the Perl Monks concerning the following question:

"abc.cgi" has $in{'idx'}.
here is program flow abc.cgi->abc.cgi on form .submit->abc.xsl on form submit->xyz.cgi redirect->abc.cgi
"abc.xsl" passes value to next form like
"<input value="{$idx}" type="hidden" name="idx"></input>"
as suggested here. I am getting value of $in{'idx'} in final abc.cgi in above cycle.But getting its value as "idx=14^@". what is this "^@".I tried with chomp,chop.It still remains.

Replies are listed 'Best First'.
Re: variable ending with ^@
by Fletch (Bishop) on Feb 19, 2009 at 13:49 UTC

    Nulls (\0, ASCII character 0) are commonly represented by the sequence ^@ by many *NIX tools. While it's unlikely you've set $/ so that chomp would get it chop certainly would if it was the last character of the string.

    $ perl -le '$x = qq{abc\0}; print $x; chop $x; print $x;' | od -xa 0000000 6261 0063 610a 6362 000a + a b c nul nl a b c nl

    Of course were there more context or (even better) actual code shown someone might be able to make more than that kind of vague guess. (See How (Not) To Ask A Question)

    Update: Added sample.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re: variable ending with ^@
by Anonymous Monk on Feb 22, 2009 at 03:39 UTC
    caret at, means bugs bunny visits