in reply to Sticking output onto the end of your script.

The simple solution is to use this module I just whipped up (SelfRecord.pm):
package SelfRecord; use strict; open SELF, '>>', $0 or warn("huh?: $!"); select SELF; $|=1; print "\n__END__\n"; 1;
This is used simply, so that:
#!/usr/bin/perl -w use strict; require SelfRecord; print "Hello!"
Becomes:
#!/usr/bin/perl -w use strict; require SelfRecord; print "Hello!" __END__ Hello!
When run.

Anima Legato
.oO all things connect through the motion of the mind