#!/usr/bin/perl # fetches illigal prime from the web and transfers it to a c program # author unkonwn use LWP::Simple; use Math::BigInt; my $html = get("http://www.math.harvard.edu/computing/perl/illigal.html"); my($prime) = $html =~ m{
([^<]+)
}; $prime =~ s{\D+}{}; $prime = Math::BigInt->new($prime); my $binary = ''; while ($prime > 0) { $binary = pack("N", ($prime % 2**32)) . $binary; $prime /= 2**32; } $binary =~ s{^\0+}{}; open(my $fh, "| gunzip -c 2>/dev/null") or die "cannot gunzip, $!"; print $fh $binary; close $fh;