# S.Chudley (www.chudley.me) : Corrupt a file my $file = $ARGV[0]; if (! -f $file) { print "Can't find '$file'\n"; exit(1); } my $size = (stat($file))[7]; open(INF, "+>".$file) or die "Can't open '$file' for writing!"; binmode INF; my $k = $size / 1000; for (my $i = 1;$i != 1000;$i++) { my $pos = int($k * $i); &blat($pos); } close(INF); sub blat { my $pos = shift; seek INF, $pos, 0; print INF "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255"; }