Posted to tcl by apn at Fri Jul 01 10:04:08 GMT 2016view raw

  1. set urls {http://www.google.com http://www.youtube.com}
  2. set completion [all [lmap url $urls {
  3. [pgeturl $url] then [lambda {url http_state} {
  4. set ::urldata($url) [dict get $http_state body]
  5. } $url]
  6. }]]
  7.  
  8. # When completed, print out the content
  9. $completion done [lambda {dontcare} {
  10. parray ::urldata
  11. }]