in reply to Re^6: Reading into array with sscanf
in thread Reading into array with sscanf
It's the -textvariable. You made a reference to an element of an array and then changed to an entirely different array. Don't do that. It's not the scanf, it's that you used
If you had used($c_speed[0], $c_speed[1], $c_speed[2], $c_speed[3]) = sscanf("%d %d % +d %d", $rstring);
it would have also failed.@c_speed = sscanf("%d %d %d %d", $rstring);
and report back. This should keep your -textvariable reference correct.@c_speed[0 .. $#c_speed] = split ' ', <$rstring>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Reading into array with sscanf
by colintu (Acolyte) on Jul 16, 2024 at 19:54 UTC | |
by NERDVANA (Priest) on Jul 17, 2024 at 16:13 UTC | |
by NERDVANA (Priest) on Jul 17, 2024 at 15:59 UTC |