That's god-awful. With VCS::CMSynergy you should almost never have to parse the output of Synergy CLI command yourself.
The first thing is to stop using strings to denote the various Synergy entities, e.g. tasks. Instead wrap it in a VCS::CMSynerg::Object ("object" for short). An object stringifies to its Synergy four-part name whenever the context requires a string, so you can simply print it or use it as an argument of a CLI command. But you can also call methods on it, see below.How do you get an object? There are lots of ways. If you happen to know its four part name, say "foo.c~42:csrc:1" you can use
What can you do with an object? The simple stuff is to retrieve the parts of its four-part name
If you want to enumerate objects by queries and then inspect their attributes, but don't want to pay the (runtime) price for a gazillion "ccm attr -show ..." calls, use
If you're really into it, use
Putting all this together the above example should read:
If you have further questions, feel free to ask.