Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Importing 80+ hashed and 1 array into several perl scripts

Reply
Thread Tools

Importing 80+ hashed and 1 array into several perl scripts

 
 
Matt Breedlove
Guest
Posts: n/a
 
      11-24-2003
Ok, I dont see why this is so difficult, but it seems like all the
solutions
I have researched require me to identify each incoming variable which
is very
undesirable as there are 80+ hashes and 1 array.

Basically i have 5 script files that utilise the same 80+ hashes and
as it stands now I have the info duplicated in each script file, but
as this data will need to be modified from time to time, I would like
to have all the variables in a single config type file.

Here is a sample of the the config type file which just has alot of
hashes
%JUNIORS_SLEEPWEAR = (
"061" => "041",
"153" => "041",
"315" => "041",
"863" => "041",
"904" => "041",
"982" => "041",
"9041"=> "041"
);

%JUNIORS_SNOW_FLEECE = (
"315" => "043",
"904" => "043",
"982" => "043",
"9043" => "043"
);
%JUNIORS_SNOW_PANTS = (
"039" => "044",
"153" => "044",
"315" => "044",
"982" => "044",
"9044" => "044"
);

%JUNIORS_SNOW_JACKETS = (
"039" => "045",
"153" => "045",
"315" => "045",
"982" => "045",
"9045" => "045"
);
%JUNIOR_HOOD_CREW_SWEATSHIRTS = (
"144" => "046",
"153" => "046",
"315" => "046",
"863" => "046",
"865" => "046",
"904" => "046",
"941"=> "046",
"982" => "046",
"9046" => "046"
);

All I want are all 80+ hashes to be available in each script memory
space
I dont understand why there isnt a module where I can "use" and just
pass it an
absolute path of the script that contains all the hashes and in one
wonderful line have all the hashes loaded into that script and
available for interation?
Perhaps I'm just missing something reall basic...I'm not a newbie to
perl by any means, but have never had to do this sort of thing before
Thanks in advance
 
Reply With Quote
 
 
 
 
Eduard W. Lohmann
Guest
Posts: n/a
 
      11-24-2003
On Mon, 24 Nov 2003 10:50:50 -0800, Matt Breedlove wrote:

<snip>
> Basically i have 5 script files that utilise the same 80+ hashes and
> as it stands now I have the info duplicated in each script file, but
> as this data will need to be modified from time to time, I would like
> to have all the variables in a single config type file.

<snip>

You mean like:

do 'filename.pl';

Just create all the hashes in a separate file, and 'do' it in each script.

Good luck.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is required for perl scripts to run correct when launched from rc scripts on HPUX 11? deanjones7@gmail.com Perl Misc 13 09-10-2007 11:58 AM
Running several Perl scripts dysgraphia Perl Misc 2 03-17-2007 07:27 AM
how do you do a hashed array of a class? santogold@mn.rr.com Ruby 2 05-12-2006 07:26 AM
Advice on converting hashed packages to pseudo-hashed packages Ian Perl Misc 3 02-12-2005 12:17 AM
hashed array in array need the keys... and length Daniel Perl 1 08-14-2003 06:49 PM



Advertisments