Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: incorrect results

by ptum (Priest)
on Apr 30, 2007 at 18:26 UTC ( #612825=note: print w/ replies, xml ) Need Help??


in reply to incorrect results

Well, it isn't very easy to see what your problem is, without a little more code and some decent <code> tag formatting. Taking a wild guess, though, I'd say you might try 'eq' when comparing your parameters, since they seem to be string values. As it is, you're comparing their numerical value with '=='.


Comment on Re: incorrect results
Re^2: incorrect results
by Anonymous Monk on Apr 30, 2007 at 18:58 UTC
    hi,
    thanks for the reply. But the values are both string as well as numeric. I am concerned that the incorrect data seems to show up only for 1 set of servers, and for a particular parameter. The ssh does get the right data but some how perl seems to be getting confused when its splitting the incoming data from the various servers. FIRST DATA CAPTURE METHOD;
    my($aug, $apr) = split(/=/); $second->{$server}{$aug} = $apr; $array{$aug} = 1; @array = sort keys %array;
    SECOND DATACAPTUR METHOD:
    ($jan, $feb) = split(/=/); $first->{$server}{$jan} = $feb;
    AND then I compare these in this data structure....
    for( my $i = 0; $i <= $#array; $i++) { unless (($first->{$t1}->{$array[$i]}) == ($seco +nd->{$t2}->{$array[$i]}) ) { chomp($first->{$t1}->{$array[$i]}); print SENDMAIL "<Cell ss:StyleID=\"s22\"><Data ss:Type=\"String\">$fir +st->{$t1}->{$array[$i]}</Data></Cell>\n"; } else { chomp($first->{$t1}->{$array[$i]}); printcell($first->{$t1}->{$array[$i]}); } }
    Now the second data capture method seems to get confused when I am printing a certain paramter value for a particular set of servers. Its fine for the rest of the servers. Any idea whats happening here?

    Edited by Chady (2007-05-01 07:21 GMT) - added code tags.

      As you were asked, above, please use code tags... ie
      <c> (body of code) </c>

      As you've already seen, the Monastery is a friendly place, but it's even friendlier if you take the effort to read about the customs here... (which, by the way, disparage posting questions multiple times, or in more than one section.

      Please read Writeup Formatting Tips... and while you're at it, [id://#972] and PerlMonks FAQ, and then become one of the Reverend Monks... (something which will also help get you a warm welcome).
        <code> hi, does this help? thanks for the reply. But the values are both string as well as numeric. I am concerned that the incorrect data seems to show up only for 1 set of servers, and for a particular parameter. The ssh does get the right data but some how perl seems to be getting confused when its splitting the incoming data from the various servers. FIRST DATA CAPTURE METHOD; my($aug, $apr) = split(/=/); $second->{$server}{$aug} = $apr; $array{$aug} = 1; @array = sort keys %array; SECOND DATACAPTUR METHOD: ($jan, $feb) = split(/=/); $first->{$server}{$jan} = $feb; AND then I compare these in this data structure.... for( my $i = 0; $i <= $#array; $i++) { unless (($first->{$t1}->{$array$i}) == ($second->{$t2}->{$array$i}) ) { chomp($first->{$t1}->{$array$i}); print SENDMAIL "<Cell ss:StyleID=\"s22\"><Data ss:Type=\"String\">$first->{$t1}->{$array$i}</Data></Cell>\n"; } else { chomp($first->{$t1}->{$array$i}); printcell($first->{$t1}->{$array$i}); } } Now the second data capture method seems to get confused when I am printing a certain paramter value for a particular set of servers. Its fine for the rest of the servers. Any idea whats happening here? <\code>
Re^2: incorrect results
by Anonymous Monk on Apr 30, 2007 at 19:24 UTC
    hi, thanks for the reply. But the values are both string as well as numeri +c. I am concerned that the incorrect data seems to show up only for 1 + set of servers, and for a particular parameter. The ssh does get the + right data but some how perl seems to be getting confused when its s +plitting the incoming data from the various servers. FIRST DATA CAPTURE METHOD; my($aug, $apr) = split(/=/); $second->{$server}{$aug} = $apr; $array{$aug} = 1; @array = sort keys %array; SECOND DATACAPTUR METHOD: ($jan, $feb) = split(/=/); $first->{$server}{$jan} = $feb; AND then I compare these in this data structure.... for( my $i = 0; $i <= $#array; $i++) { unless (($first->{$t1}->{$array[$i]}) == ($seco +nd->{$t2}->{$array[$i]}) ) { chomp($first->{$t1}->{$array[$i]}); print SENDMAIL "<Cell ss:StyleID=\"s22\"><Data ss:Type=\"String\">$fir +st->{$t1}->{$array[$i]}</Data></Cell>\n"; } else { chomp($first->{$t1}->{$array[$i]}); printcell($first->{$t1}->{$array[$i]}); } } Now the second data capture method seems to get confused when I am pri +nting a certain paramter value for a particular set of servers. Its f +ine for the rest of the servers. Any idea whats happening here?
      Well, uh...
      better; sorta' better, that is.

      Now, if you will use the code tags around the code ONLY, you'll have a quite readable post.

        oh ok...now can any one see what causing the issue in my script? any help will be blessed ;]
        hi, thanks for the reply. But the values are both string as well as numeri +c. I am concerned that the incorrect data seems to show up only for 1 + set of servers, and for a particular parameter. The ssh does get the + right data but some how perl seems to be getting confused when its s +plitting the incoming data from the various servers. FIRST DATA CAPTURE METHOD;
        my($aug, $apr) = split(/=/); $second->{$server}{$aug} = $apr; $array{$aug} = 1; @array = sort keys %array;
        SECOND DATACAPTUR METHOD:
        ($jan, $feb) = split(/=/); $first->{$server}{$jan} = $feb;
        AND then I compare these in this data structure....
        for( my $i = 0; $i <= $#array; $i++) { unless (($first->{$t1}->{$array[$i]}) == ($seco +nd->{$t2}->{$array[$i]}) ) { chomp($first->{$t1}->{$array[$i]}); print SENDMAIL "<Cell ss:StyleID=\"s22\"><Data ss:Type=\"String\">$fir +st->{$t1}->{$array[$i]}</Data></Cell>\n"; } else { chomp($first->{$t1}->{$array[$i]}); printcell($first->{$t1}->{$array[$i]}); } }
        Now the second data capture method seems to get confused when I am pri +nting a certain paramter value for a particular set of servers. Its f +ine for the rest of the servers. Any idea whats happening here?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://612825]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2014-07-22 17:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (122 votes), past polls