Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Yes, I have a suggestion, stop doing this. Instead, use a vim template for new files...

~/.vimnewfile.pl.tmpl

:insert #!/usr/bin/perl use strict; use vars qw($VERSION); use LEOCHARRE::CLI2 ':all'; use LEOCHARRE::Dir ':all'; $VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)/g; exit; sub usage { qq{$0 [OPTION].. -d debug -h help -v version }} __END__ =pod =head1 NAME =head1 DESCRIPTION =head1 OPTIONS =head1 USAGE =head2 Usage Examples =head1 AUTHOR Leo Charre leocharre at cpan dot org =head1 SEE ALSO =head1 LICENSE This package is free software; you can redistribute it and/or modify i +t under the same terms as Perl itself, i.e., under the terms of the " +Artistic License" or the "GNU General Public License". =head1 DISCLAIMER This package is distributed in the hope that it will be useful, but WI +THOUT ANY WARRANTY; without even the implied warranty of MERCHANTABIL +ITY or FITNESS FOR A PARTICULAR PURPOSE. See the "GNU General Public License" for more details. =cut .

In your ~/.vimrc

autocmd bufnewfile *.pl so ~/.vimnewfile.pl.tmpl

Now, whenever you run a command like # vim file.pl , that template will show up. If you place APPNAME where you want it, you can can then do a search and replace such as :%s/APPNAME/blabla/g


In reply to Re: Perl Script to write a perl script by leocharre
in thread Perl Script to write a perl script by electroman00

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-24 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found