Sorry venerable monks this has a lot of code and output but I have no idea why I'm getting the result I am. The sub routine sets up a group of Entry boxes and tries to add default values to the boxes which it extracts from a hash. This works unless the value I'm trying to insert is -1. In which case I get -1-1 any other value outputs fine and dandy. Does perl have a special meaning for -1 if so how can I get round the problem?
As a side note I had worked without problems with this sub for sometime, and it was only luck or bad luck that I came upon a parameter of -1 in the test data.
sub build_param_input{ my $params = @_; my $file = SBSTESTFUNCTIONS::get_XML_file_name('FILE'=>"$program_ +name.pm"); $params = SBSTESTFUNCTIONS::get_vars_hash('FILE'=>$file); print Dumper(\%$params); # testing #output #$VAR1 = { # 'STOP_AFTER' => [ # 'G2155_STOP', # '-1', # undef # ], # 'START_FROM' => [ # 'G2155_START', # '-1', # undef # ], # 'RESPONSE' => [ # 'G2155_RESPONS', # 'G2155_RESPONS', # undef # ], # 'SERVICE' => [ # 'G2155_SERVICE', # 'ENQSYSSV', # undef # ], # 'SHARED' => [ # 'G2155_SHARED', # 'Y', # undef # ] # }; my $count; foreach my $key (keys(%$params)){ $count++; my $name = $lf1->Entry(-textvariable=>$key); $name->insert('e',$key); my $pinput= $lf1->Entry(-textvariable=>$$params{$key}[1]); $pinput->insert('e',$$params{$key}[1]);#Inserts the -1-1 but o +ther values OK. print "$$params{$key}[1]\n"; #to test #Output to stdout #-1 #-1 #G2155_RESPONS #ENQSYSSV #Y $name->grid(-row=>$count, -column=>1); $pinput->grid(-row=>$count, -column=>2); } $count = undef; }

In reply to Printing -1 in a Tk Entry. by Scarborough

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.