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

set urls {http://www.google.com http://www.youtube.com}
set completion [all [lmap url $urls {
    [pgeturl $url] then [lambda {url http_state} {
        set ::urldata($url) [dict get $http_state body]
    } $url]
}]]

# When completed, print out the content
$completion done [lambda {dontcare} {
   parray ::urldata
}]