Since TCL couldn't do what I wanted (blasphemy, I know), I made a perl script to do the grunt work... but I'm running into a problem... assuming that $args contains a list of argmunents like {-a 3 -b 4 -c 6}, then I do the following:
set output [exec something.pl $args]
then the perl program is passed one long argument... not seperated ones.
I've tried using 'list', 'join', 'concat', and a few others, but I can't get it right.. even when I use 'join', it seems to escape the spaces to make it one long string.
Can something help point out the (un)obvious answer to this?
SnowWolf wrote:ayup... that works well enough. *places dunce cap on head and sits in corner*
no need for that cap...it's not that obvious
eval is dangerous if you dont know what you're doing. You need an extra layer of escaping for parts that are meant to be passed on without substitutions. I guess I should have pointed this out in the first place...
set fileName {[die].now}
eval exec $fileName $args
# ...will invoke 'die'
eval [list exec $fileName] $args
# ...will do the right thing because the brackets are escaped by 'list'