473,322 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Importing 80+ hashed and 1 array into several perl scripts

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
Jul 19 '05 #1
1 1493
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.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: J. Kenney | last post by:
Good Morning, Is there a way for a function called within an _imported_ library to call back to _calling_ python program to run a function? (Shown below) Also can you overload the print...
42
by: Fred Ma | last post by:
Hello, This is not a troll posting, and I've refrained from asking because I've seen similar threads get all nitter-nattery. But I really want to make a decision on how best to invest my time....
1
by: Daniel | last post by:
By using this code I made an array from a hashed array to regain a table content and layout as received from a mysql database... my $sth = $dbh->prepare("SELECT * FROM `Groepen';");...
2
by: kuhni | last post by:
Hi everybody, I am totally desperate because I cannot solve a really simple problem: I have a specific text-file which I want to import into an existing database. The problem is that the columns...
9
by: Steve Wasser | last post by:
I need to sort a two-dimensional array. Each day I process a file with 9 comma-delimited fields, and varying amount of records (lines). I want to pull in each line, split it according to the comma...
12
by: rurpy | last post by:
Is there an effcient way (more so than cgi) of using Python with Microsoft IIS? Something equivalent to Perl-ISAPI?
3
by: MarkW | last post by:
I hope this is the correct place to post this: I am developing a web site for a e-commerce business I will be running. The site I'm setting up will be 50% store, 50% content. I'm not sure which...
5
by: David Mathog | last post by:
I'm looking at a program which stores perl scripts in an array. Each script is stored as a single entry in that array, and the whole set of them live in a single header file (escaped out the wazoo...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.