I want to check context's version in a perl script to verify that it's
recent enough. Is there a better way than this?:

#!/usr/bin/perl -w
open(IN,"echo '\\bye' |cont-en |") or
    die "Could not run cont-en\n";
while(<IN>) {
  /ver:\s+(\d+)\.(\d+)\.(\d+)/ and
    $version=sprintf("%4d%02d%02d",$1,$2,$3),last;
}
print "version=$version\n";

-- 
Wybo

Reply via email to