From: Eric S. Raymond Date: Wed, 11 Jul 2001 10:15:32 +0000 (+0000) Subject: Last Perl version. X-Git-Tag: 2.0~2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=e59aa5903e25b6f74a641463922dcc2b07d5dd13;p=imgsizer.git Last Perl version. --- diff --git a/imgsizer b/imgsizer index 12677a3..c41b998 100755 --- a/imgsizer +++ b/imgsizer @@ -87,8 +87,16 @@ Options: EOT # Anything that can fetch a URL defined on the command line -# and dump it to stdout will do here. -$fetcher = 'httpget'; +# and dump it to stdout will do here. We try a number of +# alternatives and crap out if we can't find any of them +%fetchers = {"curl":"curl", "httpget":"httpget", "lynx":"lynx -source"} +$fetcher = "" +for $trythis in keys(fetchers) { + if (system(`whereis $trythis >/dev/null`) == 0) { + $fetcher = $fetchers{trythis} + } +unless ($fetcher) + die("Can't find a remote URL fetcher.\n") # Output uppercase tags, surrounded by quotes, by default. $lower = 0;