473,770 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_SLEEPW EAR = (
"061" => "041",
"153" => "041",
"315" => "041",
"863" => "041",
"904" => "041",
"982" => "041",
"9041"=> "041"
);

%JUNIORS_SNOW_F LEECE = (
"315" => "043",
"904" => "043",
"982" => "043",
"9043" => "043"
);
%JUNIORS_SNOW_P ANTS = (
"039" => "044",
"153" => "044",
"315" => "044",
"982" => "044",
"9044" => "044"
);

%JUNIORS_SNOW_J ACKETS = (
"039" => "045",
"153" => "045",
"315" => "045",
"982" => "045",
"9045" => "045"
);
%JUNIOR_HOOD_CR EW_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 1508
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
1783
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 function to have it do redirect output to an array for a bit, and then switch it back. (for example: right before importing make print append each line to an array vice printing it, then going
42
4110
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. I'm not interested on which language is better in *general*, just for my purpose. My area of research is in CAD algorithms, and I'm sensing the need to resort to something more expedient than C++, bash scripting, or sed scripting.
1
2253
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';"); $sth->execute(); while (my $Content = $sth->fetchrow_hashref){ $array=$Content; } This part works just fine.. how ever
2
3928
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 have different names so I receive an error message when importing via the "Get External Data"-Wizard. The second problem is that this text file includes several rows without any relevant data, only symbols like "-----" in the various columns. I...
9
22065
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 into a two dimensional array (Perl has it f'r crissake), and sort by one of the fields (Purchase Order #). Trouble is, Array.Sort only supports single dimension arrays. Originally I was thinking of making a jagged array, pulling out the Purchase...
12
2360
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
2821
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 shopping cart I'll be using yet (am looking at os-commerce and miva) but the other part will be content. I will be writing reviews of products, articles on the industry, and someday may have some blogging and forums and advertising. As for perl,...
5
5546
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 to get the perl code intact through the C preprocessor.) The issue is that many of these strings are quite long, which causes gcc to throw these sorts of warnings: scripts.h:1: warning: string length '4918' is greater than the length '4095'...
1
47485
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.