"...I'll program my editor..." hippo

hippo is almost always right. An example for emacs as real monks use emacs, you know ;-)

; $Id: perl-skeleton.el,v 1.2 2017/07/14 17:13:34 karl Exp karl $ (define-skeleton perl-skeleton "...soft like butter, fits like a glove...." (nil) "#!/usr/bin/env perl\n\nuse strict;\nuse warnings;\n\n\n__END__\n") (global-set-key [f6] 'perl-skeleton)

Load the file with:

M-x load-file Load file: ~/path/to/perl-skeleton.el

Create a new file with C-x C-f and then f6 - or what ever your binding is and you get:

#!/usr/bin/env perl use strict; use warnings; __END__

Best practice is to put the code from perl-skeleton.el in your .emacs file.

Unfortunately i don't know a solution for your favorite tool, but i'm sure that there is something similar.

Best regards, Karl

Minor update: Changed path to the elisp file

Update: Possibly a little nice/helpful addendum:

#!/usr/bin/env perl # $Id: perl-skeleton.pl,v 1.3 2017/07/16 20:35:29 karl Exp karl $ use strict; use warnings; use Path::Tiny; my $file = shift || q(./hello_world.pl); die qq($file already exists!) if -e $file; my $mode = q(u+rwx); path($file)->touch->chmod($mode); my $emacs = q(/usr/bin/emacs); my $skeleton = q(perl-skeleton); my $command = qq($emacs $file -f $skeleton -f 'save-buffer'); exec $command; __END__

«The Crux of the Biscuit is the Apostrophe»

perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help


In reply to Re^5: result is not listening to if by karlgoethebier
in thread result is not listening to if by prospect

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.