$data = 'foo' x (1024*1024) ; test($data) ; sub test { if ( $_[0] =~ /foo/s ) { print "bar\n" ;} };