473,750 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

include files in perl

i am a newbie PERL programmer, oldtime C guy here....anyway, i am starting
some PERL scripts on a shared LINUX server. i cannot store my MySQL login
parametrs in the apache config, since it is shared....so i was suggested
this:

"Typically the best way to handle mysql password protection is to put it in
a "config" file, that will not be rendered as text by the web server, such
as config.php. This way if someone calls the file directly, they get a blank
page. Then use the config.php as an include in your web code. This way you
only have the password in one place, and it is protected."

my questions are, what permissions do i need to set the file at, and how do
you INCLUDE a file in a PERL (PL) script? my only perl reference book makes
no metnion?

thanks
Jul 19 '05 #1
1 20564
In article <10************ ***@nntp.acecap e.com>, daniel kaplan
<no****@nospam. com> wrote:
i am a newbie PERL programmer, oldtime C guy here....anyway, i am starting
some PERL scripts on a shared LINUX server. i cannot store my MySQL login
parametrs in the apache config, since it is shared....so i was suggested
this:

"Typically the best way to handle mysql password protection is to put it in
a "config" file, that will not be rendered as text by the web server, such
as config.php. This way if someone calls the file directly, they get a blank
page. Then use the config.php as an include in your web code. This way you
only have the password in one place, and it is protected."

my questions are, what permissions do i need to set the file at, and how do
you INCLUDE a file in a PERL (PL) script? my only perl reference book makes
no metnion?


You can use 'do', 'eval', 'require', or 'use' to include statements
from external files. Each has a slightly different action. Check your
Perl documentation.

P.S.: Many experienced Perl users dislike the all-caps version of the
word. Same for Linux. They are words, not acronyms.

FYI: this newsgroup is defunct; try comp.lang.perl. misc in the future.
Jul 19 '05 #2

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

Similar topics

1
3726
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
44
4056
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are identical with which. Write a program that prints out which file are redundant copies. Here's the spec. -------------------------- The program is to be used on the command line. Its arguments are one or
22
38556
by: Weston C | last post by:
I know of course that you can use <script src=""></script> in an HTML document to include javascript code you don't want to spill all over the page. I'm wondering if there's a way to include other pieces of javascript code from *within* javascript.... a la #include in C, @import in Java, use/require in Perl, include()/require() in PHP, etc.... Thanks, Weston
4
6791
by: Al Franz | last post by:
Editing a script that has a "sub printheader" and "sub printfooter" routine before and after it creates a web page with a message. I would like to customize this script so that I can have my own header and footer. What is the best way to do this? 1. Can you create a "sub" that references a separate file to print as a header and footer? 2. Can you include the html code in the perl script without having to include a "\" prior to every...
4
3755
by: benwylie | last post by:
I am running IIS 6.0 on Windows 2003. I would like to be able to run a perl script from a web page and include the output. I have tried doing it with an ssi: <form action='docsearch.shtml' method='get'> <!--#exec cgi="/cgi-bin/docsearch.pl--> </form> This correctly ran the script, but it was unable to include the
3
1780
by: ooba gooba | last post by:
After doing some work in both Java and ASP.NET, I came back to add some major enhancements to a PHP 4 application I built several years ago. A lot of the database access is currently sprinkled throughout the application. In the Java and .NET worlds, I would do data access code by creating classes that would handle all of the data access for each of the application data entities. This worked great and kept all the data access in one...
4
18260
by: bluebillow | last post by:
I am a new perl programer and I meet a question. I have a perl file test_1.pl like: #!/usr/bin/perl sub Test; sub Test { printf "==========================Hello, perl.\n"; return 0;
2
2386
by: naveeddil | last post by:
Hello, I use this command for including my ASP files into another it is working perfectly on my XP 2002 SP2, IIS server and also i upload to brinkster.com and working perfectly there but here is a problem on another server.... i upload my files to a new server but in the ASP file it returned me the Code in SOurce Code Back.. The code I used is: <!-- #include file="header-main.asp" --> the header file is in the same directory
4
210
by: clinisbut | last post by:
may be i'm asking a stupid question, but, is it possible to include a header file at runtime?? I have some header files with this inside: {{12, 16},{ 0x00,0x00, /* ................ */ 0x00,0x00, /* ................ */ 0x33,0x30, /* ..%%..%%..%%.... */ 0x33,0x30, /* ..%%..%%..%%.... */
0
9001
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
8838
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,...
1
9342
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
8263
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...
0
6081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4716
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...
1
3323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.