in reply to How to do the follwing in Perl OR any other software

chakreey:

Most editors that I've seen have the ability to stick in a template, and there are a zillion others. But *just for you*, here's a perl script that'll generate a template for you:

#!/usr/bin/perl my $new_file_name = shift; open my $OFH, '>', $new_file_name; print $OFH <<EOHDR; #!/usr/bin/env python # join_proteins.py --- # # Filename: $new_file_name # Description: # Author: Andy Bork # Maintainer: # Copyright (C) 2010 Andy Bork, all rights reserved. # Created: Sat May 21 16:32:14 2011 (+0530) # Version: # Last-Updated: Sat May 21 17:54:05 2011 (+0530) # By: Ray jennings # Update #: 117 # URL: # Keywords: # Compatibility: # # # Commentary: # # # # # Change log: # # # # Code: print "hello, world!\n"; print "Replace this section with the code you want.\n"; # # $new_file_name ends here EOHDR close $OFH;

With just a few simple modifications, you can have it automatically put in current copyright dates and such.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: How to do the follwing in Perl OR any other software
by chakreey (Acolyte) on Jun 24, 2011 at 20:41 UTC

    Thank you roboticus. I just came to know few key words for doing this, like "boilerplate". I googled "boilerplate" and found interesting links. I am reading on further to be able to do it myself.

    chakri