Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-22-2005, 07:59 PM   #1
Registered: Sep 2004
Location: Long Beach, CA
Distribution: FreeBSD,Ubuntu,Gentoo,MacOS
Posts: 139

Rep: Reputation: 15
include a file in perl script

I have a file that I need to include into an existing perl script. The file is nothing more than 3 variables that I wanted to apply to several perl scripts. So my questions are...

1. Since the included file is nothing but varibles, must the first line at the top of this include page still be:
#!/usr/bin/perl -w
2. In my perl script(s), is the correct syntax to call on that external file:
3. I am using "use strict;" in my perl scripts. Is this a problem?

Thanks for any help..

P.S. I am trying to accomplished the eqivilent of the PHP "include" function.

Last edited by Ateo; 04-22-2005 at 08:01 PM.
Old 04-22-2005, 09:53 PM   #2
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
1) Not necessary
2) The syntax is wrong.

Try read the doc

perldoc -f do
perldoc -f require
perldoc -f use

You know perldoc right?

3) If it causes problem, it would be about not having proper declarations of the variable


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl cgi Script can`t make file.Why? ZairSadiqov Linux - Software 1 11-22-2006 07:22 AM
Perl Script to download file apt Programming 4 10-19-2005 08:33 AM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM
need perl fuction like c #include statement for header file mrtwice Programming 5 06-19-2003 02:42 PM
Perl Script include mikeshn Programming 1 08-20-2002 09:55 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration