in reply to self repairing code
Or:BEGIN{$SIG{__WARN__}=sub{$_=pop;y-_- -;print/".*(.)"/; truncate$0,-1+-s$0;exec$0;}}//rekcaH_lreP_rehtona_tsuJ
(for both, make sure there are no trailing newlines).BEGIN{$|=$SIG{__WARN__}=sub{$_=$_[0];y-_- -;print/(.)"$/;seek _,-open( +_ ,"+<$0"),2;truncate _,tell _;close _;exec$0}}//rekcaH_lreP_rehtona_tsu +J
Note that in my versions the actual source code (that is, the characters in the file) is corrected. Run it once, and you see the familiar line - run it a second time, and nothing happens: the code has been corrected!
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: self repairing code
by teamster_jr (Curate) on Feb 24, 2004 at 14:10 UTC |