473,399 Members | 3,888 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,399 software developers and data experts.

Accessing .cfg files in perl

Hi all,

I have an issue in perl. I need to maintain some variables in an ordinary text file from which we should be able to read when ever we need them without writing the code to read files.

I thought of using a PM file which can be used to declare the constants. But I need the solution by defining those variables in a .txt or .cfg file.

Please help me out.

regards,
Satyanarayana
Aug 8 '06 #1
1 2140
bharad
7
write all your constants/declaration code in a perl program called, say, genlib.pl

wherever you need to use this, include the following line in your calling program (assuming genlib.pl is in path /var/www/cgi-bin):

include "/var/www/cgi-bin/genlib.pl";

and rest is history :)

-bharad
Aug 30 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
1
by: Julia Bell | last post by:
I would like to run the same script on two different platforms. The directory in which the script(s) will be stored is common to the two platforms. (I see the same directory contents regardless...
1
by: downtoearth | last post by:
Hi guys, I write IRC scripts from within mIRC. I decided I wanted to expand the capabilities by learning Perl, so now I have a compiler and such but am trying to figure out what's going wrong. I...
1
by: Darshan | last post by:
I have n number of C files which have French + English comments in them. Now i have written a code which greps all the comments. What is the best way to get the comments translated using a online...
2
by: shruti | last post by:
hiii all I'm tryin to call a perl script from a C program in following 2 ways- 1.By callin system function. But there's some problem because the system function is not able to executeany...
5
by: keirnna | last post by:
I am trying to access a file with perl and use substitution on that files contents and print the result of that substitution. I also need the the file I am accessing to be input on the command...
21
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 Uploading files from a local computer to a remote web server has many useful purposes, the most...
0
by: imanuelg | last post by:
Hello, I have a Unix shell script that has lots of env variables setting in it, e.g. : ... export VAR1="var1" export VAR2="var2" ... I would like to access those from Perl using...
3
by: chinnu2809 | last post by:
I have ten xml files (each xml file is executed in batch or telnet using the command (say) xyz.xml1, xyz.xml2 in batch !) Now instead of executing each and every xml every time , i have to write a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.