This script takes one argument and outputs a perl executable file ready to have code added to it! w/e lolz. It's easy enought to figure out anyway... PD code
#!/usr/bin/perl $filename = @ARGV[0]; open(FILE, ">$filename"); print{FILE}"#!/usr/bin/perl\n# $filename\nuse warnings\;\nuse strict\; +\n"; close(FILE); system("chmod 755 $filename");

Replies are listed 'Best First'.
Re: Perl template maker
by GrandFather (Saint) on Jul 21, 2006 at 21:57 UTC

    Generally it is better to use a three parameter open:

    open FILE, '>', $filename;

    to avoid surprises with interesting file names.

    Non-*nix users may wish to avoid the chmod line.

    The editor that I use with Perl allows me to insert template text. Guess what one of my templates looks like? :)


    DWIM is Perl's answer to Gödel
      There are *gaseph* non-*nix perl coders! I am appaled!
      All content posted by this user is in the Public Domain unless otherwise noted.

        You ought be delighted. At least that way Perl will remain after *nix has died the death of a thousand mutations. :)


        DWIM is Perl's answer to Gödel