This isn't a SSCCE (e.g. get is not shown), however, a couple of points. You read from STDIN but don't chomp. You don't print the reason for failure when you call die, e.g. ....or die "Can't open directory: $!\n". Hopefully you have rate limited requests so you're not hammering the sites in question. Also How do I post a question effectively?