#! perl -slw use strict; my @chars = ('a'..'z', 'A'..'Z',0..9, qw[- _ ! & ? = ] ); sub genFile { my( $fh, $mb ) = @_; my $buf = chr(0) x 1024**2; for( 1 .. $mb ) { substr $buf, $_, 1, $chars[ rand @chars ] for 0 .. 1024**2-1; print $fh $buf; } }