edit:shemp is absolutely correct... I didn't know you could do that. It is probably the best way to pull off what you want
your questions isn't 100% clear, but I think I understand your intentions
IHMO, the only way that making a package would be sensible, is if you were going to be using the same keyword list in multiple scripts, and there are a large amount of keywords
doing the following:
#package file
package myKeywords;
@list_of_words = qw(my list of words);
#User script
use myKeywords;
map {print $_ ."\n"} @myKeywords::list_of_words;
Would probably produce the result you wanted(minus your text processing)
To make a package(very rough pls no flames)
- name your package with the .pm extension
- Secondly.You will need a makefile.
use ExtUtils::MakeMaker;
WriteMakefile('NAME' => 'myKeywords');
may do the trick for the simple package above.
- You then need to run make/nmake from the same directory that your .pm file is in
perl makefile.pl
make
make test
- ..if your "make test" command is successful
make install
- 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
- Link using PerlMonks shortcuts! What shortcuts can I use for linking?
-
See Writeup Formatting Tips and other pages linked from there for more info.