Hello monks,
I would like to use an external file that contains all of my hashes and then reference that file in my scripts.
I'm not sure where to begin, or what search terms are best to learn this process. any pointers and or links to learn are welcome.
I've included a sample of my current hashes that I'm using.
%Real_time = (
0 => 'No', 1 => 'Yes',
);
%Date_format = (
0 => 'MM/DD/YY', 1 => 'DD/MM/YY', 2 => 'YY/MM/DD',
);
Also I don't think I'm correctly calling/reading my file as perl does not appear to report it available using the following code...
BEGIN {
no strict 'refs';
no warnings 'uninitialized';
printf("package %s\n", __PACKAGE__);
for (qw( unit_id )) {
printf("%s: exists:%s defined:%s prototype:%s\n",
$_,
exists(&{$_}) || 0,
defined(&{$_}) || 0,
prototype($_),
);
}
}
returns unit_id: exists:0 defined:0 prototype:
sorry I forgot that little bit.
thank you
-
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.