Skip to content

Conversation

@MoriTanosuke
Copy link

I tried to add weight graph parsing to the API today and I can read the description with the actual values and parse it. But I could only print it to the debug logger, but when I tried to use it from the test_client.pl script, it is always returning 1 instead of my current weight...

Can you have a look at it and give me a hint for a solution?

@ericblue
Copy link
Owner

Hi,

I don't have time to review the code in detail right now, but at a glance it might be something as simple as string concatenation in your test client script. It's more than likely returning the value "1" due to the way you're printing out the value of get_weight_log. The return value is an array, and since you're using a period (.) to concatenate the string it's treating the array as a scalar (1 = total elements in the array). Try using a comma instead. Also, when in doubt try using Data::Dumper to print out the return call.

@MoriTanosuke
Copy link
Author

Ah, thanks for the hint. The different data structures and the implicit conversions in Perl are my main enemy. I try to fix this in the evening.

… converted from array to scalar in API.pm, line 574+.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants