#!/usr/bin/perl if ($#ARGV != 0 || ($ARGV[0] ne "c" && $ARGV[0] ne "cc" && $ARGV[0] ne "Perl" && $ARGV[0] ne "Makefile")) { print "Usage: mklicence.pl { c | cc | Perl | Makefile } output-file\n"; exit 0; } $lang = $ARGV[0]; $filename = $ARGV[1]; if ($lang eq "c") { print "/*\n"; while () { print " * $_"; } print " */\n"; } elsif ($lang eq "Perl" || $lang eq "Makefile") { if ($lang eq "Perl") { print "#! /usr/bin/perl\n"; } while () { print "# $_"; } } else { while () { print "// $_"; } }